This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 16396 - Speed up DataObject.files ()
Summary: Speed up DataObject.files ()
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: phamernik
URL:
Keywords: PERFORMANCE
: 19021 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-09 16:30 UTC by Jaroslav Tulach
Modified: 2008-12-23 13:35 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2001-10-09 16:30:13 UTC
Please consider speeding up the DataObject.files () for the most common cases of
usage by providing lazy Set that will compute its values on demand. So
checkFiles (a method to recognize secondary entries) will not be called until
really needed.

The most common operation is just call files () and do nothing ;-) As is done in
DataNode.getDisplayName () if the underlaying filesystem is local file system (a
FileSystem.annotateName method is called which does nothing). To speed up this
case simple lazy Set is enough.

The second most common operation is files ().iterator ().next () done in
core.projects.SystemFileSystem.annotateName (...) which is not used as offen
(templates and other stuff on default filesystem), but speedup would be nice. To
speed up this case an enhancement to the lazy set that will return
DataObject.getPrimaryFile () as first item of the set is needed and only when
somebody asks for more items the checkFiles is called and rest of the set
initialized.

Please consider making this a new (package private) class in loaders package -
creating new innerclasses in MultiDataObject would probably not be so nice.
Comment 1 Jaroslav Tulach 2001-10-22 15:37:00 UTC
Not a bug, because it does not stop anything right now, but I would
like to see this fixed for next version. => EHN + P2
Comment 2 Jan Chalupa 2001-11-27 13:02:08 UTC
Target milestone -> 3.3.1.
Comment 3 Petr Nejedly 2002-01-08 14:39:23 UTC
*** Issue 19021 has been marked as a duplicate of this issue. ***
Comment 4 Petr Nejedly 2002-01-08 14:52:03 UTC
While implementing this, please take into consideration the
requirements of #19021, i.e. the Set's iterator should keep the same
order over the time but the order should be computer lazily too.
And don't forget to document the special behaviour.
Comment 5 phamernik 2002-04-05 14:47:44 UTC
Implemented in org.openide.loaders.FilesSet class.
Test was written for it: org.openide.loaders.MultiFileObjectFilesTest
Comment 6 Jan Zajicek 2002-04-26 16:00:17 UTC
Ok, verified.
Comment 7 Quality Engineering 2003-07-01 16:38:32 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.