Bug 266295 - [Contributions] ShowInContext.getSelection() should only be called when needed
Summary: [Contributions] ShowInContext.getSelection() should only be called when needed
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2009-02-26 08:28 EST by Dani Megert CLA
Modified: 2009-03-10 13:21 EDT (History)
0 users

See Also:


Attachments
Fix (6.65 KB, patch)
2009-02-26 08:29 EST, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-02-26 08:28:08 EST
I20090224-0800, but like that since at least R3.3.

For some editors computing the selection for the ShowInContext can be expensive, e.g. the Java editor needs to reconcile the Java Model with the current document state. For that reason the selection should only be queried when the ShowIn menu is opened or the ShowIn handler called. Currently, each time a Java editor is activated it has to reconcile in the UI thread.

NOTE: We could do the same for the input but given that the input of a part is already present calling getInput() should really be a NOP.
Comment 1 Dani Megert CLA 2009-02-26 08:29:06 EST
Created attachment 126842 [details]
Fix

Hi Paul, here's a first try to fix this.
Comment 2 Paul Webster CLA 2009-03-04 11:19:42 EST
(In reply to comment #1)
> Created an attachment (id=126842) [details]
> Fix

Looks straight forward, performance on the UI tests was the same, and all of my current usecases pass with it.

I've released to HEAD >20090304
PW
Comment 3 Paul Webster CLA 2009-03-10 13:16:08 EDT
I've confirmed that the fix is in and my usecases still work in I20090310-0100

Dani, does this give you the perf improvement you expected?

PW
Comment 4 Dani Megert CLA 2009-03-10 13:21:36 EDT
Yes, I verified that this fixes our issued.