Bug 118733 - JSP validation performance
Summary: JSP validation performance
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords: performance
: 158637 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-30 18:59 EST by Tim deBoer CLA
Modified: 2011-11-14 16:37 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim deBoer CLA 2005-11-30 18:59:59 EST
Sorry if this is a dup, but I couldn't find any open bugs on this topic. JSP validation performance is way better than earlier milestones, so please don't think I'm trying to get down on you. Thanks for all the work that has already been done.

However, JSP validation of small/empty files is still an order of magnitude slower than Java compilation. I've been trying to fix some scalability bugs lately, and building up a Web project with 1000+ JSP files is painful. Although we can now process several files per second, even pasting in a directory with this many empty JSP files causes an extremely long build.
Comment 1 David Williams CLA 2005-12-03 05:22:04 EST
We'll approach this problem first by getting some good use caes, and find out where the time goes ... sepcially when compared with Java! 
Comment 2 Phillip Avery CLA 2005-12-05 16:58:19 EST
I put in some simple timing/print statements to see where the bottlenecks were.

It looks like JSPTranslation#reconcileCompilationUnit() takes the most time for validation (as expected).  In that method we're doing a CU.makeConsistant(), and right after we do a CU.reconcile() call.  

We might not need the "makeConsistant()" call, which takes a good amount of the time in that method.  I've got to investigate a little more.

In fact, the javadoc says:

Note: Using this functionality on a working copy will interfere with any
 * subsequent reconciling operation.  Indeed, the next {@link ICompilationUnit#reconcile}
 * operation will not account for changes which occurred before an
 * explicit use of {@link #makeConsistent(IProgressMonitor)}

which is exactly what we're doing...
Comment 3 Tim deBoer CLA 2005-12-05 17:21:38 EST
I don't know the code, but even a couple of edge-case optimizations would help, e.g. don't validate empty files or anything obviously broken. In my cases the files have been either empty or very simple, so it seems like we could make some optimizations here that we couldn't with larger or more complex JSP files.
Comment 4 David Williams CLA 2006-03-28 03:24:11 EST
Mass transfer from pa to dw. Needs more triage. 
Comment 5 David Williams CLA 2006-09-07 09:30:32 EDT
performance bugs should use performance keyword (not [performance] in subject). 
Comment 6 Ian Tewksbury CLA 2010-01-21 11:05:53 EST
Aaaa, another JSPTranslation#reconcileCompilationUnit() bug.  The description is right, there are many bugs open about this problem.  The best that can be done on this front is that Bug 299423 will cause JSPTranslations to be persisted to disk so that this expensive call does not have to be made unless a JSP file changes or of course on the first add.  There is no way around the fact that the JSP documents need to be translated for indexing though and the first time through is going to have to have this call, and any changes to the JSP documents.

Though #makeConsistent(IProgressMonitor) is still in use with #reconcile so it would be worth looking into if the #makeConsistent call is needed.
Comment 7 Nick Sandonato CLA 2010-10-05 17:42:37 EDT
*** Bug 158637 has been marked as a duplicate of this bug. ***
Comment 8 Nick Sandonato CLA 2011-11-14 16:37:13 EST
As Ian mentioned, a lot of work has gone in to making sure translations are only performed when necessary. In addition to this, I've cleaned up the use of makeConsistent as this seems largely unnecessary. Ad hoc testing as well as unit tests have all gone well.