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 183946 - 3s building editor menu
Summary: 3s building editor menu
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: PERFORMANCE
: 213426 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-12 19:21 UTC by misterm
Modified: 2013-07-24 02:36 UTC (History)
14 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 163193


Attachments
nps snapshot (256.00 KB, application/nps)
2010-04-12 19:21 UTC, misterm
Details
nps snapshot (15.84 KB, application/nps)
2010-05-03 18:59 UTC, jirka_x1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2010-04-12 19:21:41 UTC
Build: NetBeans IDE Dev (Build 100412-2e53179720ff)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12
OS: Windows XP

User Comments:
GUEST: Clicking in the text editor



Maximum slowness yet reported was 5295 ms, average is 4280
Comment 1 misterm 2010-04-12 19:21:49 UTC
Created attachment 97119 [details]
nps snapshot
Comment 2 Jaroslav Tulach 2010-04-16 15:39:16 UTC
I am looking at:
http://statistics.netbeans.org/exceptions/exception.do?id=312087

The 3s are spend in 
org.netbeans.modules.editor.NbEditorKit$NbBuildPopupMenuAction.buildPopupMenu()
and are then split into various insignificant times all over including querying lookup, classloading, etc.

I think the simplest way to get UI responsiveness here is to apply "do sooner" rule. Could the popup menu of the editor (defined per EditorKit, if I am not mistaken) be built while prloading the NbEditorKit in its call() method?

Creating actions outside EQ thread shall be possible. Calling their isEnabled method is not, but that could be possibly done one by one in invokeLater...
Comment 3 jirka_x1 2010-05-03 18:59:18 UTC
Created attachment 98392 [details]
nps snapshot
Comment 4 Svata Dedic 2013-07-17 07:24:51 UTC
*** Bug 213426 has been marked as a duplicate of this bug. ***
Comment 5 Svata Dedic 2013-07-21 18:29:30 UTC
I've added code preload into NbEditorKit.call(), the actions are actually instantiated + instruction built how to create a popup menu from the instances, but since proper use of the pre-created info (= caching) would require invalidation etc on SFS changes, I just load the instances and trash the data. Could be extended to caching implementation in the future.

Fixed in http://hg.netbeans.org/jet-main/rev/c565304ea877
Comment 6 Quality Engineering 2013-07-24 02:36:38 UTC
Integrated into 'main-silver', will be available in build *201307232300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c565304ea877
User: Svata Dedic <sdedic@netbeans.org>
Log: #183946: Popup menu action code os preloaded after editor open