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.
Build 200502271900 1) Have fresh userdir 2) Create new Web Project 3) Edit index.jsp 4) Type at line 14: <%/*%> (unfinished Java comment) 5) Place cursor at the end of this modified line 14 6) Hold any key for a while 7) ERROR: It takes 100% of my processor. Notice: - Doing the same thing at line 37 (last JSP line) takes only 52% of processor. - Same case without <%/*%> text takes 42% of processor
I will take a look at it.
CCing editor guys.
The problem is caused by the unclosed java comment in the scriptlet. When JSP parser parses the line it runs java syntax parser on the scriptlet code and waits for java parser to return error token (e.g. %>). But inside java comment almost nothing is error, so the java parser parses the document from the scriptlet start offset to the end of the document. This takes very long time ofcourse. Since the javaparser returns one big token for java block comment, there is not easy way how to fix in on the side of jsp multisystax parser. A simple solution can be to divide the java block tokens by lines. The change in java syntax is simple and it seems that the change doesn't break anything. A proposed patch is attached. After applying this patch the performance improvement is huge! Note that for more than 200 lines long JSPs with the <% /* %> on the beginning of the file the performance is terrible. You cannot write, you almost cannot navigate over the file. Milo, Mato, please consider the proposed fix and let me know your opinions.
Created attachment 20630 [details] Proposed patch
I would prefer to have a boolean flag for this in an extra constructor of the JavaSyntax used solely by JSP to not cause any regressions in the java editor. Having that I'm OK with the patch.
Sounds good to me. I will do that. Thanks.
For me is the solution with the flag good as well.
fixed Checking in java/editor/lib/src/org/netbeans/editor/ext/java/JavaSyntax.java; /cvs/java/editor/lib/src/org/netbeans/editor/ext/java/JavaSyntax.java,v <-- JavaSyntax.java new revision: 1.3; previous revision: 1.2 done Processing log script arguments... More commits to come... Checking in web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JSPKit.java; /cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JSPKit.java,v <-- JSPKit.java new revision: 1.18; previous revision: 1.17 done
Verified in 200503061900. Although I discovered similar performance problem - see reopened issue 55525.
v