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 245639 - CtrlClick navigation hangs in huge JavaScript files
Summary: CtrlClick navigation hangs in huge JavaScript files
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-14 10:58 UTC by NukemBy
Modified: 2014-07-22 14:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profiler Snapshot: NB-CtrlClick Navigation in Javascript.npss (51.47 KB, application/octet-stream)
2014-07-14 10:58 UTC, NukemBy
Details
Screenshot: Locking ... *.js (15.97 KB, image/jpeg)
2014-07-14 11:00 UTC, NukemBy
Details
NB-CtrlClick Navigation in Java (19.09 KB, application/octet-stream)
2014-07-14 14:23 UTC, NukemBy
Details
HotThreads: Long Ctrl_Click JS navigation (72.41 KB, application/x-zip-compressed)
2014-07-22 14:55 UTC, NukemBy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NukemBy 2014-07-14 10:58:18 UTC
Created attachment 148028 [details]
Profiler Snapshot: NB-CtrlClick Navigation in Javascript.npss

Not sure if it depends on size of JS files, but i have rather frequent problem - after I Ctrl+Click some symbol in JS files (in all cases I remember it was something around 3000+ lines and 100K of JS code) NB hangs with the 'lengthy opertaion' which never ends - one of the CPU core is 100% busy forever and no CTRL+Click navigation is possible in any of the file (no matter if it JS or Java). 

Additionally, in some cases, when I wait rather long I'm not able to save changes in original JS file - dialog with the message "Lengthy operation is in progress: Locking ...my.js (Cancel)" prevents me from saving.

I've attached snapshot from NS selfprofiler.
Comment 1 NukemBy 2014-07-14 11:00:07 UTC
Created attachment 148029 [details]
Screenshot: Locking ... *.js
Comment 2 NukemBy 2014-07-14 14:23:28 UTC
Created attachment 148040 [details]
NB-CtrlClick Navigation in Java
Comment 3 NukemBy 2014-07-14 14:26:30 UTC
Got the same problem in Java (not JS) file. Another snapshot is attached.

All CPU time still goes to JS staff - Thread:Editor Parsing Loop ->  ... -> org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveTypeFromExpression()
Comment 4 NukemBy 2014-07-22 14:55:21 UTC
Still appears, was waiting for navigation for 30+ seconds ... tried sniffing via  HotThreads - https://weblogs.java.net/blog/brucechapman/archive/2008/03/hot_threads.html.

It show the performance bottleneck is somewhere around 
org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveAssignments(ModelUtils.java:1175)

One of the stack traces:

  5/10 snapshots sharing following 42 elements
    org.netbeans.modules.parsing.spi.indexing.support.QuerySupport$IndexerQuery.getIndices(QuerySupport.java:895)
    org.netbeans.modules.parsing.spi.indexing.support.QuerySupport$Query$1.call(QuerySupport.java:572)
    org.netbeans.modules.parsing.spi.indexing.support.QuerySupport$Query$1.call(QuerySupport.java:569)
    org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
    org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
    org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:74)
    org.netbeans.modules.parsing.spi.indexing.support.QuerySupport$Query.execute(QuerySupport.java:569)
    org.netbeans.modules.parsing.spi.indexing.support.QuerySupport.query(QuerySupport.java:368)
    org.netbeans.modules.javascript2.editor.index.JsIndex.query(JsIndex.java:204)
    org.netbeans.modules.javascript2.editor.index.JsIndex.getProperties(JsIndex.java:401)
    org.netbeans.modules.javascript2.editor.index.JsIndex.getProperties(JsIndex.java:337)
    org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveAssignments(ModelUtils.java:1226)
    org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveAssignments(ModelUtils.java:1175)
    org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveTypeFromExpression(ModelUtils.java:853)
    org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveTypes(ModelUtils.java:1117)
    org.netbeans.modules.javascript2.editor.JsStructureScanner$JsSimpleStructureItem.<init>(JsStructureScanner.java:561)
    org.netbeans.modules.javascript2.editor.JsStructureScanner.getEmbededItems(JsStructureScanner.java:144)
    org.netbeans.modules.javascript2.editor.JsStructureScanner.getEmbededItems(JsStructureScanner.java:124)
    org.netbeans.modules.javascript2.editor.JsStructureScanner.getEmbededItems(JsStructureScanner.java:124)
    org.netbeans.modules.javascript2.editor.JsStructureScanner.scan(JsStructureScanner.java:97)
    org.netbeans.modules.csl.navigation.ElementScanningTask$1.run(ElementScanningTask.java:172)
    org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:598)
    org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:155)
    org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:139)
    org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:206)
    org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:203)
    org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
    org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
    org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:74)
    org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:203)
    org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:106)
    org.netbeans.modules.csl.navigation.ElementScanningTask.computeStructureRoot(ElementScanningTask.java:160)
    org.netbeans.modules.csl.navigation.ClassMemberPanelUI$1.run(ClassMemberPanelUI.java:226)
    org.netbeans.modules.csl.navigation.ClassMemberPanelUI$1.run(ClassMemberPanelUI.java:216)
    org.netbeans.modules.csl.navigation.ClassMemberNavigatorSourceFactory$ProxyElementScanningTask.run(ClassMemberNavigatorSourceFactory.java:138)
    org.netbeans.modules.csl.navigation.ClassMemberNavigatorSourceFactory$ProxyElementScanningTask.run(ClassMemberNavigatorSourceFactory.java:110)
    org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:573)
    org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:744)
    java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    java.util.concurrent.FutureTask.run(FutureTask.java:262)
    org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
    org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)


More traces is attached ...
Comment 5 NukemBy 2014-07-22 14:55:52 UTC
Created attachment 148209 [details]
HotThreads: Long Ctrl_Click JS navigation