Bug 187684 - Slow to show debug drop-down
Summary: Slow to show debug drop-down
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2007-05-17 17:10 EDT by Nick Edgar CLA
Modified: 2007-05-23 12:20 EDT (History)
3 users (show)

See Also:
Michael_Rennie: review+
curtis.windatt.public: review+


Attachments
YourKit CPU traces (9.03 KB, application/zip)
2007-05-17 17:11 EDT, Nick Edgar CLA
no flags Details
patch (8.52 KB, patch)
2007-05-18 12:30 EDT, Darin Wright CLA
no flags Details | Diff
updated patch (9.01 KB, patch)
2007-05-23 11:22 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2007-05-17 17:10:01 EDT
3.3 M6

Showing the debug toolbar drop-down takes ~2 seconds in my environment, and creates ~17M of garbage (according to the heap status monitor).

Profiling in YourKit shows that for 7 launch configs, it's doing 49 calls to LaunchConfiguration.exists(), which accounts for 100% of the time.  The 7 exists() checks lead to 35 calls to WorkspaceRoot.findFilesForLocation(IPath), which leads to 7420 calls to FileSystemResourceManager.getFileURI(URI) and a similar number of other resource and URI operations.  

See attached CPU traces for details.  One shows the merged callees from LaunchConfiguration.exists(), the other shows the merged callers to LaunchConfiguration.exists().
Comment 1 Nick Edgar CLA 2007-05-17 17:11:25 EDT
Created attachment 67728 [details]
YourKit CPU traces
Comment 2 Nick Edgar CLA 2007-05-17 17:18:07 EDT
The slowness is only seen when the launch configs are saved to the workspace (Shared file in the Common tab).  Of the 7 launch configs in my list, 5 are shared (you'll see this in the caller trace).

The caller trace shows many redundant calls to exists().  If this could be reduced to 1 exists() check for each launch config, this would be sped up by a factor of 7.  

The number 35 comes from 5 shared launch configs * 7 exists() calls each.

The fan-out from 35 to 7420 is due to the number of projects with custom filesystems in my workspace (212).

I showed this to John, who is looking into possible improvements on the core resources side.

Could the call to findFilesForLocation(IPath) be eliminated entirely? In the UI, it prompts for a workspace resource, not a filesystem path.  Could the launch config remember that instead?  If it's remembering the filesystem path instead, it seems like that would be prone to problems as well, e.g. if the project is moved to another filesystem location.

Comment 3 Darin Wright CLA 2007-05-18 12:30:32 EDT
Created attachment 67820 [details]
patch

This reduces the calls by a factor of 10. We may be able to improve this more.
Comment 4 Dani Megert CLA 2007-05-21 10:06:48 EDT
Darin, can we target this for 3.3?

See also bug 174148.
Comment 5 Darin Wright CLA 2007-05-23 11:22:53 EDT
Created attachment 68363 [details]
updated patch
Comment 6 Curtis Windatt CLA 2007-05-23 12:14:55 EDT
+1 speedy
Comment 7 Michael Rennie CLA 2007-05-23 12:19:39 EDT
speeeeeedy indeed +1, applied patch
Comment 8 Michael Rennie CLA 2007-05-23 12:20:35 EDT
verified