Bug 66189 - PDE class path container initialization performance
Summary: PDE class path container initialization performance
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 63367 78747 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-08 13:50 EDT by Erich Gamma CLA
Modified: 2004-12-13 00:46 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Gamma CLA 2004-06-08 13:50:35 EDT
the performance trace in bug# 65638 indicates a significant amount of time is 
spend in initializing the pde class path container (69%). This should be 
further analyzed.
Comment 1 Jeff McAffer CLA 2004-06-08 15:09:47 EDT
seems like rebuilding the pde model is reparsing plugin.xmls and regen'ing 
manifests etc etc.  This is done every time regardless of whether there were 
changes.  It seems this whole process is quite heavy and could benefit from 
some level of caching.
Comment 2 Wassim Melhem CLA 2004-06-08 15:17:37 EDT
>This is done every time regardless of whether there were changes. 
every time meaning upon every startup, correct?
Comment 3 Jeff McAffer CLA 2004-06-08 15:35:10 EDT
right.  every startup it appears that some amount of manifest regeneration is 
being done.
Comment 4 Wassim Melhem CLA 2004-06-08 15:41:50 EDT
I have already logged a bug report regarding this issue (bug 63367).
This is definitely a step backwards as far as PDE is concerned from 2.1.

In 2.1, we were able to use RegistryCacheReader and RegistryCacheWriter to 
read/save target platform data and reuse it if the target platform underwent 
no changes from invocation to invocation.  This gave us great improvement for 
WSADIE, etc.

We don't have an equivalent plan for the new runtime.  Is there anything 
equivalent that Core can provide for us to use/copy/subclass/whatever to cache 
state?
Comment 5 Jeff McAffer CLA 2004-06-08 16:28:36 EDT
suggest you close one of the bugs as a dupe.

StateReader and StateWriter are not API but you can copy the code to persist 
your state.  Similarly, the RegistryCacheReader and RegistryCacheWriter are not 
API but can be copied and used as you need.  

I believe that in both cases they are not doing anything internal/special.  
That is, you can take these as guides as to how to persist the data or copy 
them outright.

As discussed previously, we are shying away from having the runtime provide 
tooling specific API/function.  I bulks up the code, confuses the API and 
inhibits our ability to do optimizations and remain lean.  We're happy to 
supply code, advice and other help.
Comment 6 Wassim Melhem CLA 2004-06-08 18:56:38 EDT
Thanks Jeff.  As always, we will take you up on your offer.

Will look at the StateReader/StateWriter classes.  Even with the old runtime, 
we maintained our own trimmed-down version of these cache reader/writer 
classes.  So no problems with copying code here <g>.

Too late for this item to go into RC2.  Definitely a top (and hopefully only) 
candidate for RC3, as without caching, performance is worse off than in 2.1.  
Comment 7 Wassim Melhem CLA 2004-06-08 18:57:20 EDT
*** Bug 63367 has been marked as a duplicate of this bug. ***
Comment 8 Wassim Melhem CLA 2004-06-09 12:15:32 EDT
*** Bug 66320 has been marked as a duplicate of this bug. ***
Comment 9 Rafael Chaves CLA 2004-06-09 16:23:22 EDT
Actually, there is API for clients saving/restoring their states:
StateObjectFactory#write/readState.
Comment 10 Wassim Melhem CLA 2004-06-09 16:25:19 EDT
Thanks Rafael.  How do you cache extensions?
Comment 11 Rafael Chaves CLA 2004-06-09 16:38:54 EDT
Extensions/extension points are a separate issue, the API I mentioned above is
intended for saving states (bundle descriptions and constraints between them).
That would avoid unnecessary manifest generation. However, we don't provide API
for saving/restoring an extension registry cache (we keep the two models in
separate places). You will have to have a look at the classes Jeff mentioned.
Beware that you need to keep the extension registry model in sync with the state
(if the state cache is outdated, the extension registry must be discarded as well).

Comment 12 Wassim Melhem CLA 2004-12-12 13:23:17 EST
*** Bug 78747 has been marked as a duplicate of this bug. ***
Comment 13 Wassim Melhem CLA 2004-12-13 00:46:59 EST
Fixed.

PDE now uses the runtime support to write/read the state for the target 
platform.

As for all other data not contained within the state, e.g. libraries, 
extensions and extensions points, etc., PDE now uses our own caching 
mechanisms for these objects.

The litmus test whether to throw away the cache and recompute anew is if a 
hash function of the timestamps of all plugin.xml/fragment.xml/MANIFEST.MF 
files in the target platform returns a value that is different from the cached 
one.

Will attach numbers later on today to illustrate the before and after on a 
huget target platform.