[jbosstools-issues] [JBoss JIRA] (JBIDE-12948) SelectionBar uses too much CPU resources
Yahor Radtsevich (JIRA)
jira-events at lists.jboss.org
Tue Nov 13 13:59:17 EST 2012
[ https://issues.jboss.org/browse/JBIDE-12948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yahor Radtsevich reassigned JBIDE-12948:
----------------------------------------
Assignee: Alexey Kazakov (was: Yahor Radtsevich)
Looks OK for me.
> SelectionBar uses too much CPU resources
> ----------------------------------------
>
> Key: JBIDE-12948
> URL: https://issues.jboss.org/browse/JBIDE-12948
> Project: Tools (JBoss Tools)
> Issue Type: Sub-task
> Components: Visual Page Editor core
> Affects Versions: 4.0.0.Beta1
> Reporter: Yahor Radtsevich
> Assignee: Alexey Kazakov
> Fix For: 4.0.0.CR1
>
> Attachments: 12948a.patch
>
>
> While profiling VPE JUnits it seems that up to 70% of all time of their execution is performed in the method org.jboss.tools.jst.jsp.selection.bar.SelectionBar.setVisible(boolean):
> {code}
> public void setVisible(boolean visible) {
> if (visible) {
> splitter.setVisible(realBar, true);
> splitter.setVisible(emptyBar, false);
> } else {
> splitter.setVisible(realBar, false);
> splitter.setVisible(emptyBar, true);
> }
>
> /* JBIDE-7387:
> * By default toolbar size is set to fit regular button ToolItems.
> * But drop-down items are a little bigger and do not
> * fit in the default-size toolbars (at least under Windows XP).
> * This temporary ToolItem is needed to set enough size to the toolbar.*/
> ToolItem tempItem = new ToolItem(toolbar, SWT.DROP_DOWN);
> tempItem.setText(" "); //$NON-NLS-1$
> tempItem.setEnabled(false);
> this.getParent().layout(true, true);
> tempItem.dispose();
> }
> {code}
> The call of {{this.getParent().layout(true, true);}} is very expensive.
> I could suggest two fixes here:
> # The panel should know if it is already visible or not. If the same state is requested, the method should do nothing.
> # [Optionally!] Calculate the height of the toolbar only once, and then just pass this height to the layout manager.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list