Bug 135084 - [Contributions] Expensive unnecessary calls to PluginAction::refreshEnablement()
Summary: [Contributions] Expensive unnecessary calls to PluginAction::refreshEnablement()
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2006-04-05 13:00 EDT by Yasser Lulu CLA
Modified: 2019-09-06 15:30 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yasser Lulu CLA 2006-04-05 13:00:13 EDT
Every WWinPluginAction registers itself as a SelectionListener,and, when it recieves a selectionChanged event, it goes and calculates its enablement although the end-user has no way to invoke such the action which means calculating enablement is unnecessary at all. This causes performance problems for enviroenment with large number of object-contribution actions and when a large number of elements are selected at once in some viewer, especially if the action has an enablementExpression since this guy will iterate over every single element in the selection and will performs the enablement tests -sometime through an IActionFilter::testAttribute(...) on each and every one of them. This unnecessary processing makes a simple act of clicking on an element in a tree viewer quite costly although it doesn't have to be. Perhaps all these action can short-cicuit the enebalement calculations if they cannot be invoked at all (i.e., no context-menu or pulldown menu is about to show and they are not visible in the action bar of the viewer ...etc.)
Comment 1 Boris Bokowski CLA 2006-04-13 15:51:07 EDT
Don't know if [Workbench] is the correct component area for this.  Sounds like a good fit for Duoung too.
Comment 2 Michael Valenta CLA 2006-06-01 09:46:22 EDT
Popup menu object contributions do not listen to selection changes. It is only contributions that appear in the main menu, toolbars or views that listen to selection changes. They need to update their enablement even if they are not visible since they may have keybindings associated with them. 

Given that there can be a large number of these, it would still be worthwhiel to investigate possible performance improvements. For starters, we should verify that a failed expression or action filter test halts processing on the entire selection (i.e. a single failed element measn that the contribution is not applicable).
Comment 3 Paul Webster CLA 2007-04-05 19:05:02 EDT
Assigning to component owner
PW
Comment 4 Eclipse Webmaster CLA 2019-09-06 15:30:25 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.