Bug 84912 - [KeyBindings] performance: Lots of garbage when editor gains/loses focus
Summary: [KeyBindings] performance: Lots of garbage when editor gains/loses focus
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-02-10 11:53 EST by DJ Houghton CLA
Modified: 2005-02-15 11:35 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2005-02-10 11:53:23 EST
build i0208

Not sure where to enter this report. Adding Tod and John to CC as they will be
involve in performance work this release.

I have the Platform/UI heap usage plug-in installed. I notice that when I switch
focus from the editor to a view (e.g. Outline), the heap usage increases by a
meg or 2. Putting focus back to the editor does the same.

This happens with both the text editor and more prominatly with the Java editor.

It doesn't matter if the view is docked or is a fast view.
Comment 1 Kim Horne CLA 2005-02-11 00:51:20 EST
Assigning to Tod to get this out of the inbox.  Please reassign if necessary.
Comment 2 John Arthorne CLA 2005-02-14 11:09:52 EST
This is caused by the JFace key binding code.  2.5 MB of
Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry objects are
created each time the Java editor gains focus.  A smaller amount (1 to 1.5 MB)
is allocated when other parts gain/lose focus.
Comment 3 Douglas Pollock CLA 2005-02-14 17:38:20 EST
I added a reverse look-up map, and a performance test.  The performance tests
went from about 65000 ms to about 140 ms.

The bound on the method also went from O(n) to O(1) [amortized], which helps
significantly on large binding sets.

John: could you verify this fix sometime Tuesday or Wednesday?
Comment 4 John Arthorne CLA 2005-02-15 11:35:20 EST
Verified in I20050215-0800

Part activations no longer cause any of those entry objects to be created. 
There are still about 200-300 KB of garbage objects created on each part
activation (when switching focus between editor and outline, for example). This
almost all comes from key formatter code. I'm not familiar enough with this code
to know if there are further opportunities for improvement.  Anyway, the main
performance bug here is fixed and verified.