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 26311 - .settings files are parsed 2+ times
Summary: .settings files are parsed 2+ times
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2002-08-06 13:56 UTC by Petr Nejedly
Modified: 2008-12-22 21:40 UTC (History)
3 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 Petr Nejedly 2002-08-06 13:56:08 UTC
During the IDE startup, each of the .settings
files under the Services folder will get parsed at
least twice during the FolderLookup
initialization.

It is caused by this code in the core:
SerialDataConvertor.java:73
        if (isModuleEnabled()) { 
            instance = createInstance(null); 
            lkpContent.add(instance); 
        }

where in isModuleEnabled->getModuleInfo() is code
to create/parse an instance:
String module = new
SettingsInstance(null).getSettings(true).getCodeNameBase();
and the parsed instance is immediatelly forgotten
and created again from above mentioned
instance = createInstance(null); 
and is parsed again later (on demand).

It is possible to keep the parsed instance,
which will significantly speed up the FolderLookup
initialization.
Comment 1 Petr Nejedly 2002-08-06 14:06:05 UTC
I'm not sure whether this is a long-time behaviour or a regression.
CCing Trung, he will certainly be interrested.
Comment 2 _ ttran 2002-08-07 08:01:52 UTC
Can we measure how much time does one round of .settings parsing cost?
Comment 3 Petr Nejedly 2002-08-07 08:42:22 UTC
The difference in FolderLookup initialization on my machine was
about 6100ms vs. 4800ms when I added side band for reusing the data
parsed in getModuleInfo().
The parse() calls were reduced from 225 to 125 during the IDE startup.
It is in par with one .settings file parsing cost of ~10ms

the 2+ means some files are parsed three times, but the last parsing
is IMO OK - it is the full parsing in case somebody wants the
instance, while the first parsing is header-only parsing which breaks
as soom as the needed headers are parsed. But there can still be
some space for improvements.
Comment 4 Jan Pokorsky 2002-08-07 10:48:22 UTC
You are right. There are up to 3 parsing cycles
1. parsed just header to find out MI
2. parsed just header to find out classes' names
3. parsed the whole file to be able to read a persisted object.

ad 1) could be eliminated by sharing results in steps 1 and 2
ad 3) performed just in case someone calls InstanceCookie.instanceCreate and MI.isEnabled == true

Definitely the step 1 is eliminated by using settings convertors. They do not need any MI at all and 
should be the prefered way to store settings now.
Comment 6 Petr Nejedly 2002-08-12 18:05:15 UTC
Thanks.
It have sped up the IDE startup on my machine by about 1.5s ;-)
Comment 7 Petr Nejedly 2002-08-12 18:07:36 UTC
I think this safe and benefical fix should be included in 3.4.1
Comment 8 Jaroslav Tulach 2002-12-03 09:54:03 UTC
Hi. This issue is marked as 3.4.1_CANDIDATE. It means that it should be
integrated into release341 one branch. The plan at
http://www.netbeans.org/devhome/docs/releases/34/index.html expected beta1 to be
produced on Dec01. That did not happen due to a lot of outstanding not
integrated candidates like this one. 

Would it be possible to spend few minutes by backporting this fix? Thank you in
advance.
Comment 9 Jan Pokorsky 2002-12-03 17:17:04 UTC
integrated to the release341 branch

/cvs/core/src/org/netbeans/core/projects/SerialDataConvertor.java,v1.8.18.1
Comment 10 Jesse Glick 2003-01-15 15:40:44 UTC
How can Version == 4.0 dev and Target Milestone == 3.4.1?? Please fix
the Version field.
Comment 11 Jan Pokorsky 2003-01-15 15:52:38 UTC
version changed to 3.4
Comment 12 _ mihmax 2003-01-15 16:08:07 UTC
How?
Simple - the bug was reported against 4.0dev, but then discovered to
be in 3.4 too,
Was fixed in trunk and release341, hence Target Milestone is 3.4.1.

The question is, whether we're supposed to backwards-search all the
bugs, whether they are applicable to 3.3, 3.2, 0 or it's simply that
Version must be <= than Target milestone you are opposing, Jesse?
Comment 13 Quality Engineering 2003-07-01 16:39:09 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.