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 9568 - Performance - better handling of module's XML layers
Summary: Performance - better handling of module's XML layers
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 normal (vote)
Assignee: anovak
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2001-02-12 16:35 UTC by anovak
Modified: 2008-12-22 19:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anovak 2001-02-12 16:35:57 UTC
We have all module layers covered by one MultiFileSystem that uses a linear
searching for operations e.g. getAttribute(), findResource(), etc.

We should provide a better, more specialized, implementation for this case.

There are two proposals - add a new addXML() method to XMLFileSystem, or
merge XML documents to one and then create new XMLFileSystem.

We should gain performance boost on startup - 10%. We could lose CPU ticks in
an "uninstall module" action, as we will need to rebuild this filesystem.
Comment 1 Jesse Glick 2001-02-13 11:13:59 UTC
Or, a special subclass of MultiFileSystem (for read-only delegates only) that
would precalculate all attributes and file structure. I.e.: keep a cache of
known file structure, and when a new delegate is added, merge its contents into
this cache. If a delegate is deleted, recalculate the cache. This approach would
remove anything specific to XMLFileSystem and might be easier to understand.
Comment 2 Jaroslav Tulach 2001-02-14 00:19:59 UTC
Is not the trouble with the way how MultiFileSystem handles attributes? I know
that Jesse enhanced it to allow to store attributes for file from any layer
(even the layer is read-only). As far as I know the algorithm scans all(?)
layers to find if a file object has attribute or not.

I think that the real bottleneck is this algorithm.

Would it be an improvement to just check all delegates of a file object plus
value on the first (read-write) filesystem layer?
Comment 3 Jaroslav Tulach 2001-02-14 00:22:59 UTC
The problem with addXML is that it does not logically fit into the public
interface, it is useful just for this special case. The possible solution would
be to create own URLHandler, URLConnection that would use SequenceInputStream
and merge all layers from all modules together. Because the XMLFileSystem does
not use validating parser, it could work.
Comment 4 rmatous 2001-02-14 09:21:59 UTC
That`s true that addXML does not logically fit into the public interface. We
could bend it a little: setXmlUrl and getXmlUrl could be considered as  getter
and setter for primary URL and add methods setSecondaryXmlUrl and
getSecondaryXmlUrl with obvious meaning. SystemName would reflect primary URL.
Implementation would be really easy. It is also not bad idea to merge all
documents using SequenceInputStream.
Comment 5 _ pkuzel 2001-02-14 10:18:59 UTC
Take care that in the case of SequenceInputStream that all files must:
* use same encoding
* be free of prologs <?xml
* an artifial file adding prolog and root element must be introduced
* an artifial file closing root element must be introduced

Not sure if it is not too complex. May be, a solution introducing master
document referencing all others would be easier (however it does not eliminate
performace problem with creating Readers for every external entity).
Comment 6 anovak 2001-02-16 08:15:55 UTC
I have to add something here to assign this bug :-(
Comment 7 Jan Chalupa 2001-03-12 12:08:45 UTC
Version: 'Dev' -> 3.2
Comment 8 Jaroslav Tulach 2001-04-03 14:12:27 UTC
Let's leave it for 3.3
Comment 9 Jan Chalupa 2001-05-06 08:10:48 UTC
Target milestone -> 3.3
Comment 10 Petr Nejedly 2001-08-02 17:33:00 UTC
Already implemented - XMLFileSystem.setXmlUrls() in v1.32
Comment 11 Petr Nejedly 2001-12-18 11:38:05 UTC
something
Comment 12 Quality Engineering 2003-07-01 16:28:22 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.