Bug 28158 - [resources] Improve SaveManager save/snap/restore
Summary: [resources] Improve SaveManager save/snap/restore
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Debbie Wilson CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 10994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-12-12 08:00 EST by Adam Kiezun CLA
Modified: 2003-02-10 14:52 EST (History)
2 users (show)

See Also:


Attachments
startup (9.22 KB, text/plain)
2002-12-12 08:01 EST, Adam Kiezun CLA
no flags Details
startup with leading whitespace trimmed (more readable) (5.15 KB, text/plain)
2003-01-23 15:22 EST, Debbie Wilson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-12-12 08:00:37 EST
20021210
on startup, 40% of time is spent in SaveManager.startup()
maybe that could be improved
Comment 1 Adam Kiezun CLA 2002-12-12 08:01:04 EST
Created attachment 2765 [details]
startup
Comment 2 DJ Houghton CLA 2002-12-12 09:10:12 EST
Related to bug 28135 which requests more instrumentation around resources
plug-in startup.
Comment 3 DJ Houghton CLA 2003-01-20 09:40:28 EST
*** Bug 10994 has been marked as a duplicate of this bug. ***
Comment 4 DJ Houghton CLA 2003-01-23 15:01:46 EST
The resources plug-in has now been instrumented with debug information on
startup/shutdown time.

Debbie, please analyze and report potential problem areas and solutions here. 

Thanks.
Comment 5 Debbie Wilson CLA 2003-01-23 15:22:34 EST
Created attachment 3111 [details]
startup with leading whitespace trimmed (more readable)
Comment 6 DJ Houghton CLA 2003-01-23 16:29:33 EST
I believe that one area which could be improved is marker/syncinfo 
saving/restoring. This could be improved both in the file format and in 
mechanism that we use for getting the information to store.

We should look at leveraging the new fast visitor mechanism as well as the 
internal element tree visitor.
Comment 7 Debbie Wilson CLA 2003-01-28 14:39:31 EST
The following timings were recorded when restoring the 'big' workspace 
(http://eclipse.org/eclipse/development/performance/big-workspace.html).  All 
time numbers are milliseconds.  Clearly, this would indicate that restoring 
metaInfo is the most expensive restore operation.

full restore			6625
master table			  16 -  2.41%
tree for workspace		1218 - 18.38%
markers for workspace		1250 - 18.87%
syncInfo for workspace		 969 - 14.63%
metaInfo for workspace		3156 - 47.64%
unaccounted			  16 -  2.41%

full restore			4625
master table			  15 -  0.32%
tree for workspace		 703 - 15.20%
markers for workspace		 485 - 10.49%
syncInfo for workspace		 500 - 10.81%
metaInfo for workspace		2922 - 63.18%
unaccounted			   0 -     0%

full restore			5547
master table			   0 -     0%
tree for workspace		 765 - 13.79%
markers for workspace		 485 -  8.74%
syncInfo for workspace		 515 -  9.28%
metaInfo for workspace		3766 - 67.89%
unaccounted			  16 -  0.29%

full restore			4531
master table			   0 -     0%
tree for workspace		 687 - 15.16%
markers for workspace		 454 - 10.02%
syncInfo for workspace		 500 - 11.04%
metaInfo for workspace		2874 - 63.43%
unaccounted			   0 -     0%
Comment 8 Debbie Wilson CLA 2003-01-28 15:33:45 EST
Average Times for Restore Information (above):
AVERAGE:
full restore			5332.00
master table			   7.75 -  0.15%
tree for workspace		 843.25 - 15.81%
markers for workspace		 668.50 - 12.54%
syncInfo for workspace		 621.00 - 11.65%
metaInfo for workspace		3179.50 - 59.63%
unaccounted			   8.00 -  0.15%


Similar data collected for Save (on workspace shutdown):
AVERAGES:
full save			3418.25
master table			  31.75 -  0.93%
tree for workspace		 605.25 - 17.71%
markers for workspace		  86.00 -  2.52%
syncInfo for workspace		  74.50 -  2.18%
metaInfo for workspace		 132.50 -  3.88%
unaccounted			2488.25 - 72.79%

Data used to compute the above average (for save):
full save			3688
master table			  79 -  2.14%
tree for workspace		1218 - 33.03%
markers for workspace		 110 -  2.98%
syncInfo for workspace		  94 -  2.55%
metaInfo for workspace		 124 -  3.36%
unaccounted			2063 - 55.94%

full save			3453
master table			  32 -  0.93%
tree for workspace		 375 - 10.86%
markers for workspace		  94 -  2.72%
syncInfo for workspace		  77 -  2.23%
metaInfo for workspace		 171 -  4.95%
unaccounted			2704 - 78.31%

full save			3235
master table			   0 -     0%
tree for workspace		 344 - 10.63%
markers for workspace		  79 -  2.44%
syncInfo for workspace		 111 -  3.43%
metaInfo for workspace		 110 -  3.40%
unaccounted			2591 - 80.09%

full save			3297
master table			  16 -  0.49%
tree for workspace		 484 - 14.68%
markers for workspace		  61 -  1.85%
syncInfo for workspace		  16 -  0.49%
metaInfo for workspace		 125 -  3.79%
unaccounted			2595 - 78.71%



Comment 9 Debbie Wilson CLA 2003-01-30 14:38:31 EST
Recommendations:
1 - (startup/resolve) Bug 3012 suggests converting ModelObjectReader from a 
DOM based XML parser to a SAX based parser.
2 - (shutdown/save) Use new IResourceVisitorProxy instead of IResourceVisitor
3 - (shutdown/save) SafeFileOutputStream.copy(...) should use File.renameTo
(...) before calling transferStreams.  transferStreams should only be called 
if the rename fails.
4 - (shutdown/save) SafeFileOutputStream.copy should use buffered streams if 
calling transferStreams (see note 3 above).


NOTE:  Majority of time on saves in the 'unaccounted' category is spent 
closing files (hence recommendations #3 and #4 above).
Comment 10 DJ Houghton CLA 2003-01-31 11:56:46 EST
Old Summary: [startup] SaveManager takes 40% of startup time

Released changes to SafeFileOutputStream to HEAD.

Have refactored SaveManager w.r.t. persistence of markers and syncinfo now 
visiting the element tree directly. Requires more testing before release.
Comment 11 DJ Houghton CLA 2003-02-03 10:08:09 EST
Released changes for persisting markers and sync info to HEAD.
Comment 12 DJ Houghton CLA 2003-02-10 14:52:55 EST
Closing this bug report. Bug 3012 covers the remaining issue of converting the 
ModelObjectReader from DOM to SAX parsing.