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 212105 - JspKit.createSyntax slow - LowPerformance took 9988 ms.
Summary: JspKit.createSyntax slow - LowPerformance took 9988 ms.
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: issues@javaee
URL:
Keywords: PERFORMANCE
: 211925 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-04 19:09 UTC by Alexander Simon
Modified: 2013-01-04 02:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 187671


Attachments
nps snapshot (648.03 KB, application/nps)
2012-05-04 19:09 UTC, Alexander Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2012-05-04 19:09:25 UTC
This bug was originally marked as duplicate of bug 197534, 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 20120504-56a062a89a32)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.6-b01, Java(TM) SE Runtime Environment, 1.6.0_31-b04
OS: Linux
Maximum slowness yet reported was 9988 ms, average is 9988
Comment 1 Alexander Simon 2012-05-04 19:09:57 UTC
Created attachment 119099 [details]
nps snapshot
Comment 2 David Strupl 2012-11-12 12:04:19 UTC
The last report seems to be from JSP - please evaluate.
Comment 3 Marek Fukala 2013-01-02 15:13:10 UTC
As for the latest JSP related reports - it seems to be either JVM totally out of resources or some faulty snapshot as according to it the PropertyChangeSupport.addPropertyChangeListener() takes 11 seconds. Closing.
Comment 4 Marek Fukala 2013-01-02 15:16:35 UTC
The JSPKit.createSyntax() is called many times which seems to be the problem
Comment 5 Marek Fukala 2013-01-02 15:17:01 UTC
*** Bug 211925 has been marked as a duplicate of this bug. ***
Comment 6 Marek Fukala 2013-01-02 15:21:13 UTC
Each SyntaxElement.getNext() causes the whole syntax to reinitialize (BaseDocument.getFreeSyntax()) which then calls the JspKit.createSyntax() which attaches the listener to the JspColoringData but seems to never free it. That's likely the reason why adding the listener is so slow as there might be millions of them.
Comment 7 Marek Fukala 2013-01-03 10:04:06 UTC
I tried to find some elegant and right solution of the problem, but it would require to rewrite or copy parts of the code which I personally consider as a subject of total redesign so I just did a simple workaround. 

BTW, if a client of SyntaxElement needs to traverse the whole chain of elements( as the JspFoldManager) the current implementation is extremely inefficient as it recreates the tokens chain and the syntax several times for each of the elements.

web-main#70a94ba1d8d1
Comment 8 Quality Engineering 2013-01-04 02:31:41 UTC
Integrated into 'main-golden', will be available in build *201301040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/70a94ba1d8d1
User: Marek Fukala <mfukala@netbeans.org>
Log: #212105 - JspKit.createSyntax slow - LowPerformance took 9988 ms.