This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 45650 - TopComponent.requestActive() is slow
Summary: TopComponent.requestActive() is slow
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-06-28 16:01 UTC by Maros Sandor
Modified: 2008-12-22 14:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
suggested patch. (758 bytes, patch)
2004-06-29 13:11 UTC, Milos Kleint
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maros Sandor 2004-06-28 16:01:18 UTC
When the JPDA debugger stops on a breakpoint it 
calls (among other things) Line.show
(Line.SHOW_GOTO) which in turn calls 
TopComponent.requestActive(). If I remove this 
last call I can speed up stepping in debugger two 
times. Please evaluate if code behind this call 
causes such slowdown. It eats ~100ms even if that 
component is already showing and active.
Comment 1 Milos Kleint 2004-06-29 13:02:15 UTC
reassigning.
Comment 2 Milos Kleint 2004-06-29 13:11:48 UTC
Created attachment 16055 [details]
suggested patch.
Comment 3 Milos Kleint 2004-06-29 13:15:15 UTC
can you please try to do your measurements agains with the provided
patch? (Reassign back to me then)

thanks.
Comment 4 Maros Sandor 2004-06-29 14:12:22 UTC
This patch saves some 40-50 ms on average so this still unnecessarily 
takes 50-60 ms. Good progress though.
Comment 5 Milos Kleint 2004-06-29 15:01:04 UTC
ok, I've applied the patch, along with another minor improvement
(which however I don't believe to have major impact on the time)

There's not much to do since the code in

TopComponent.requestActive() ->
WindowManagerImpl.topComponentRequestActive() ->
Central.activateModeTopComponent() 

is pretty straightforward. The problem probably resides somewhere else
than TopComponent.requestActive.

closing as fixed.
Comment 6 Zdenek Konecny 2005-07-08 12:27:49 UTC
I mark it closed because it's too old and I think, in current NetBeans 4.2
(Build 200507061800) the stepping in debugger is fast enough.  
Comment 7 mslama 2007-05-07 14:56:50 UTC
BTW you can use WindowManager.getDefault().getRegistry().getActivated() to get
activated TC and if it is already equals to TC you want to activate you can omit
call TC.requestActive(). It should be fastest way.