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 232264 - Replace EditorCookie.getOpenedPanes() with something faster
Summary: Replace EditorCookie.getOpenedPanes() with something faster
Status: RESOLVED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX, PERFORMANCE
Depends on:
Blocks:
 
Reported: 2013-07-04 12:05 UTC by misterm
Modified: 2013-09-03 14:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 201909


Attachments
nps snapshot (201.51 KB, application/nps)
2013-07-04 12:05 UTC, misterm
Details
screenshot (145.85 KB, image/png)
2013-08-30 15:47 UTC, markiewb
Details
profiler snapshot (16.32 KB, application/octet-stream)
2013-08-30 15:49 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2013-07-04 12:05:30 UTC
This bug was originally marked as duplicate of bug 227989, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 20130703-4ccc4c622a55)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.3-b01, Java(TM) SE Runtime Environment, 1.7.0_07-b11
OS: Windows 7

User Comments:
misterm: .



Maximum slowness yet reported was 3237 ms, average is 3237
Comment 1 misterm 2013-07-04 12:05:32 UTC
Created attachment 136713 [details]
nps snapshot
Comment 2 Stanislav Aubrecht 2013-07-08 08:26:55 UTC
OpenFilesSearchScopeProvider.OpenFilesScope.isFromEditorWindow is asking for CloneableEditorSupport.getOpenedPanes which may be costly.
Please check if there's an alternate API for that, thanks.
Comment 3 Jaroslav Havlin 2013-08-29 14:09:20 UTC
I've tried replacing
"editor.getOpenedPanes() != null"
with
"editor.getDocument() != null",
but it's not guaranteed that it returns null for already closed documents.
More investigation is needed.
Comment 4 markiewb 2013-08-30 15:47:28 UTC
Created attachment 139506 [details]
screenshot

I also had such an issue that NB froze today.

Product Version: NetBeans IDE Dev (Build 201308290001)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)

Right before I installed http://plugins.netbeans.org/plugin/45925/sort-line-tools.
I sampled NB while it was frozen. See attachment (screenshot and snapshot).

The root cause seems to be https://github.com/markiewb/nb-sort-line-tools/blob/master/src/org/netbeans/modules/linetools/actions/AbstractLineAction.java?source=cc#L80
Comment 5 markiewb 2013-08-30 15:49:17 UTC
Created attachment 139507 [details]
profiler snapshot
Comment 6 markiewb 2013-08-30 15:51:35 UTC
(In reply to markiewb from comment #4)
> The root cause seems to be
> https://github.com/markiewb/nb-sort-line-tools/blob/master/src/org/netbeans/
> modules/linetools/actions/AbstractLineAction.java?source=cc#L80

If this is really my fault (BTW I only repacked the plugin, sandchiptale was the original author) please tell me which API I can use to fix it.
Comment 7 markiewb 2013-08-30 16:08:17 UTC
(In reply to markiewb from comment #6)
> (In reply to markiewb from comment #4)
> > The root cause seems to be
> > https://github.com/markiewb/nb-sort-line-tools/blob/master/src/org/netbeans/
> > modules/linetools/actions/AbstractLineAction.java?source=cc#L80
> 
> If this is really my fault (BTW I only repacked the plugin, sandchiptale was
> the original author) please tell me which API I can use to fix it.

{code}
JEditorPane pane = NbDocument.findRecentEditorPane(ec);
{code}
would be the solution I guess - taken from http://hg.netbeans.org/main-golden/rev/21e2a273a524
Comment 8 markiewb 2013-08-31 16:20:55 UTC
(In reply to markiewb from comment #7)
> (In reply to markiewb from comment #6)
> > (In reply to markiewb from comment #4)
> > > The root cause seems to be
> > > https://github.com/markiewb/nb-sort-line-tools/blob/master/src/org/netbeans/
> > > modules/linetools/actions/AbstractLineAction.java?source=cc#L80
> > 
> > If this is really my fault (BTW I only repacked the plugin, sandchiptale was
> > the original author) please tell me which API I can use to fix it.
> 
> {code}
> JEditorPane pane = NbDocument.findRecentEditorPane(ec);
> {code}
> would be the solution I guess - taken from
> http://hg.netbeans.org/main-golden/rev/21e2a273a524

FYI: If it was an issue caused by the plugin, so it is now solved by version 1.12.
* https://github.com/markiewb/nb-sort-line-tools/commit/c92ddf60b18ad21b9654830719945344e8365e56
* http://plugins.netbeans.org/plugin/45925 (currently pending for verification)
Comment 9 Jaroslav Havlin 2013-09-03 14:21:52 UTC
> JEditorPane pane = NbDocument.findRecentEditorPane(ec);
Fixed in http://hg.netbeans.org/core-main/rev/cc60d35659aa.
Thank you very much.