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 194943 - Callers of TaglibParseSupport.getCachedParseResult() are blocked for long time by JSP parsing thread [was:LowPerformance took 6683 ms.]
Summary: Callers of TaglibParseSupport.getCachedParseResult() are blocked for long tim...
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2011-02-01 12:37 UTC by ads_green
Modified: 2016-07-07 08:52 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 176344


Attachments
nps snapshot (18.95 KB, application/nps)
2011-02-01 12:37 UTC, ads_green
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ads_green 2011-02-01 12:37:17 UTC
This bug was originally marked as duplicate of bug 183951, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.0 Beta (Build 201011152355)
VM: Java HotSpot(TM) 64-Bit Server VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04
OS: Windows 7

User Comments:
ads_green: Go to declaration of a jsp tag from a jsp file.



Maximum slowness yet reported was 6683 ms, average is 6683
Comment 1 ads_green 2011-02-01 12:37:23 UTC
Created attachment 105544 [details]
nps snapshot
Comment 2 David Konecny 2011-02-01 19:11:21 UTC
org.netbeans.modules.web.core.syntax.JspHyperlinkProvider seems to be at fault.
Comment 3 Marek Fukala 2014-07-30 11:07:55 UTC
I found these two common cases:

[1] http://statistics.netbeans.org/exceptions/exception.do?id=681272 

in EDT: 

JspKit$JspInsertBreakAction.actionPerformed() -> 
Indent.reindent() -> 
ParserManager.parse() -> 
java.source.save.Reindenter.reindent() -> 

tries to get java source for the JSP file

TaglibParseSupport.getCachedParseResult()

waits for the jsp parsing thread to finish its slow parsing.

[2] http://statistics.netbeans.org/exceptions/exception.do?id=683834

code completion thread: 

JspCompletionProvider.query() ->

TaglibParseSupport.getCachedParseResult()

waits for the jsp parsing thread to finish its slow parsing.


Both cases are caused by the clients of 

TaglibParseSupport.getCachedParseResult()

which calls that method (indirectly) with successfulOnly == true and preferCurrent == true arguments, which causes the calling thread to block and wait for the JSP parser parsing finishes.

A solution would be either speed up the jsp parsing significantly (very complicated to impossible) or let the clients use the existing (last) parsing result. 

I'd go for the second option, however the consequences may be severe and hard to foresee. The code is quite complicated and messy, moreover there're are almost no tests so doing such change a day before code freeze seems too much to my liking. However I'd give it a try in the next version.
Comment 4 Martin Balin 2016-07-07 08:52:40 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss