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

Summary: MasterFileSystem$StatusImpl.annotate[Icon|Name] spends too much time on transforming fileobjects
Product: platform Reporter: Antonin Nebuzelsky <anebuzelsky>
Component: FilesystemsAssignee: rmatous <rmatous>
Status: RESOLVED FIXED    
Severity: blocker CC: issues, jtulach
Priority: P2 Keywords: PERFORMANCE
Version: 4.x   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 49995    
Bug Blocks: 41084    
Attachments: Diff with impl. Please test whether it is crucial improvement. if not then its useless to pollute the code with such lazy sets

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