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 41118 - MasterFileSystem$StatusImpl.annotate[Icon|Name] spends too much time on transforming fileobjects
Summary: MasterFileSystem$StatusImpl.annotate[Icon|Name] spends too much time on trans...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: rmatous
URL:
Keywords: PERFORMANCE
: 49850 (view as bug list)
Depends on: 49995
Blocks: 41084
  Show dependency tree
 
Reported: 2004-03-18 15:36 UTC by Antonin Nebuzelsky
Modified: 2008-12-23 00:03 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff with impl. Please test whether it is crucial improvement. if not then its useless to pollute the code with such lazy sets (4.49 KB, patch)
2004-04-02 14:23 UTC, rmatous
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-03-18 15:36:14 UTC
Methods
MasterFileSystem$StatusImpl.annotate[Icon|Name]
first transform the given set of fileobjects into
another set of fileobjects (the underlying ones).
Then it calls annotate[Icon|Name] on the
underlying FS with the new set.

But the set of fileobjects *is not always used* in
the called annotate method (e.g. with a local FS)
and thus creating the transformed set is waste of
time.

Instead a lazy set should be passed to the
underlying annotate method and the lazy set would
do the transformantion only if asked for something...
Comment 1 rmatous 2004-04-02 14:23:30 UTC
Created attachment 14260 [details]
Diff with impl. Please test whether it is crucial improvement. if not then its useless to pollute the code with such lazy sets
Comment 2 _ tboudreau 2004-05-05 10:10:38 UTC
FYI, this issue now also applies to annotateNameHtml, which is a copy of the code in 
annotateName delegating to FileSystem.HtmlStatus instead of FileSystem.Status
Comment 3 Antonin Nebuzelsky 2004-05-05 12:28:24 UTC
Hm, there is no measurable improvement with the attached diff. (with
yesterday sources, on W2k on a local filesystem, expanding folder of
1000 java files)
Comment 4 rmatous 2004-10-04 11:40:14 UTC
*** Issue 49850 has been marked as a duplicate of this issue. ***
Comment 5 Jaroslav Tulach 2004-10-04 12:45:22 UTC
The issue 49850 that has been marked duplicate of this one is P2, so I
am fixing that state as people might not realize that.
Comment 6 rmatous 2004-10-06 10:57:06 UTC
There is no measurable perf. improvement because of insufficient impl
of DataNode.LazyFilesSet. At least first element from Iterator must be
returned quickly because I need at least one FileObject to decide
where to delegate.

Comment 7 rmatous 2004-10-07 13:54:31 UTC
Fixed. Although VCSFS still iterate through all items to annotate also
 secondary files. 

/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/MasterFileSystem.java,v
 new revision: 1.17; previous revision: 1.16

/cvs/openide/masterfs/src/org/netbeans/modules/masterfs/Utils.java,v 
new revision: 1.3; previous revision: 1.2

/cvs/openide/masterfs/test/unit/src/org/netbeans/modules/masterfs/MasterFileObjectTestHid.java,v
 new revision: 1.17; previous revision: 1.16