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 220246

Summary: KeymapViewModel forces initialization in AWT thread
Product: editor Reporter: lolo_101 <lolo_101>
Component: Key bindingsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal CC: exceptions_reporter, jhavlin, KhArtNJava, mgoe, pjiricka
Priority: P3 Keywords: PERFORMANCE
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 182639
Bug Depends on:    
Bug Blocks: 205383, 218924    
Attachments: nps snapshot

Description lolo_101 2012-10-17 08:11:56 UTC
Build: NetBeans IDE 7.3 Beta (Build 201210011125)
VM: Java HotSpot(TM) Client VM, 20.10-b01, Java(TM) SE Runtime Environment, 1.6.0_35-b10
OS: Windows XP

User Comments:
mgoe: Refreshing CVS status.



Maximum slowness yet reported was 16443 ms, average is 6387
Comment 1 lolo_101 2012-10-17 08:11:59 UTC
Created attachment 126051 [details]
nps snapshot
Comment 2 Ondrej Vrabec 2012-10-17 08:28:29 UTC
class-loading in versioning -> nothing to fix on our side. However maybe the callers could move their code outside of the EDT:
reports 619163, 616644 - org.netbeans.modules.options.keymap.KeymapViewModel$1.run()	100.0	2,938 ms (100%)	2,599 ms
report 609822 - org.netbeans.core.output2.OutputTab.createActions()	99.75492	16,289 ms (99.8%)	15,778 ms

passing forward for evaluation, feel free to close if you cannot move to background.
Comment 3 Theofanis Oikonomou 2012-10-24 16:05:13 UTC
I think there is nothing that can be done in options about this. Re-assigning in keymaps for evaluation. Thanks
Comment 4 Svata Dedic 2012-10-30 12:10:50 UTC
I went through the reports; report #585037 was assigned to Version control (possible performance issue).

The rest of the reports exhibit two problems:
1/ the initialization of the keymap model is replanned to AWT thread (!). So even if the implementor switches to background, as OutputTab does (report #616644, #619163), the UI is blocked by action loading. Report #609822 is partially fixed as issue #217765 in OutputTab, but because of replaning to AWT, synchronization model for Keymap(View)Model must be changed.

2/ Snaphots #552820, #539907 shows slow initialization of the content in the case the user switched to the keymap tab. 

Both issues can be fixed if the initialization will move to either a dedicated request processor, not awt, or will perform in the caller's thread without replanning, AND the options pane will load the data in the background, updating the panel after load completes. Some placeholder message can be shown in the meantime.
Comment 5 Svata Dedic 2012-11-05 10:06:00 UTC
Changeset: 461229c02263
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-11-05 11:05
Message:   Keymap options synchronized, replanning to AWT thread removed. Support for local copies to provide cancel support.
Comment 6 Svata Dedic 2012-11-05 11:46:24 UTC
Changeset: c2a4b87bdda2
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-11-05 12:46
Message:   Shortcuts list is initialized off AWT thread.
Comment 7 Svata Dedic 2012-11-05 15:27:24 UTC
*** Bug 219202 has been marked as a duplicate of this bug. ***
Comment 8 Milutin Kristofic 2012-11-05 16:15:10 UTC
*** Bug 219788 has been marked as a duplicate of this bug. ***
Comment 9 Quality Engineering 2012-11-07 03:45:01 UTC
Integrated into 'main-golden', will be available in build *201211070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/461229c02263
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #220246 - KeymapViewModel forces initialization in AWT thread: fixed
Keymap options synchronized, replanning to AWT thread removed. Support for local copies to provide cancel support.
Comment 10 Svata Dedic 2012-11-20 15:43:18 UTC
*** Bug 218160 has been marked as a duplicate of this bug. ***
Comment 11 Svata Dedic 2013-06-20 13:31:01 UTC
*** Bug 223336 has been marked as a duplicate of this bug. ***