You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/10/31 05:10:51 UTC

DO NOT REPLY [Bug 43741] New: - .tag files in a .tar recompiled for each .jsp -- extremely slow (with fix)

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43741>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43741

           Summary: .tag files in a .tar recompiled for each .jsp --
                    extremely slow (with fix)
           Product: Tomcat 6
           Version: 6.0.9
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: aberglas@rsa.com


Jasper is *extremely* slow at compiling .tag files packaged in a .jar -- tens 
of seconds per JSP. One cause is that .tag files are repeatedly recompiled for 
each .jsp even though they have not changed.

The following few lines fix this.  The added code is marked between // --------
 AJB markers.  
It effectively turns off the timestamp checking on .jar files.

This does NOT actually introduce a bug.  There is an existing bug in that .jsp 
files are not 
automatically recompiled if any .tags in .jars are changed.  So you need to 
purge work in either case.  
A proper fix would be to check dependencies properly, at least to the .jar 
file itself.  
But the current fix is *much* better that the existing behavior.

There are better solutions, but an 80% solution is better than no solution.


// Tomcat 6.0.10 Src deployed version.

public class JspCompilationContext {...

    public void compile() throws JasperException, FileNotFoundException {
        createCompiler();

        // ------------ begin AJB
        // Hack to stop .tag files that are packaged in .jars being recompiled 
for every single .jsp that uses them.
        // The hack means that .tag files will not be automatically recompiled 
if they change -- you need to delete work area.
        // But that was actually an existing bug -- .jsps are not dependent on 
the .tag .jars so the work area needed deleting anyway.
        // (Outstanding is to compile multiple .tags in one pass and so make 
the process Much faster.)
        boolean outDated;
        if (isPackagedTagFile) outDated = ! new File(getClassFileName()).exists
();
        else outDated = jspCompiler.isOutDated();
//        AjbLog.log("### Compiler.compile " + jspUri + " pkgTagFile " + 
isPackagedTagFile + " outDated " + outDated + " " + getClassFileName());
        if (outDated) {
//     if (isPackagedTagFile || jspCompiler.isOutDated()) { // original code.
//     ---------------- end AJB
            try {
                jspCompiler.removeGeneratedFiles();
                jspLoader = null;
                jspCompiler.compile();
                jsw.setReload(true);
                jsw.setCompilationException(null);
            } catch (JasperException ex) {
                // Cache compilation exception
                jsw.setCompilationException(ex);
                throw ex;
            } catch (Exception ex) {
                JasperException je = new JasperException(
                            Localizer.getMessage("jsp.error.unable.compile"),
                            ex);
                // Cache compilation exception
                jsw.setCompilationException(je);
                throw je;
            }
        }
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43741] - .tag files in a .tar recompiled for each .jsp -- extremely slow (with fix)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43741>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43741


markt@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From markt@apache.org  2008-02-21 14:42 -------
This has been committed to 6.0.x and will be in 6.0.17 onwards.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43741] - .tag files in a .tar recompiled for each .jsp -- extremely slow (with fix)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43741>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43741





------- Additional Comments From markt@apache.org  2008-02-04 15:01 -------
I have a proper fix for this now:
http://svn.apache.org/viewvc?rev=618481&view=rev

It has been committed to trunk and proposed for 6.0.x

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43741] - .tag files in a .tar recompiled for each .jsp -- extremely slow (with fix)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43741>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43741





------- Additional Comments From markt@apache.org  2008-01-29 15:17 -------
I have looked at this some more.

I think your patch is pretty much spot on. Generally, if a JAR changes, the app
needs to be re-loaded (eg using reloadable or watched resources). That is true
for any other JAR and I don't see why it shouldn't be true for JARs containing
tag files.

Compiling tags in a single pass (bug 43742) would also help.

Bug 43878 will also contribute to poor performance, although in a different way.

Your patch has been applied to trunk and proposed for 6.0.x.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43741] - .tag files in a .tar recompiled for each .jsp -- extremely slow (with fix)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43741>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43741





------- Additional Comments From markt@apache.org  2008-02-01 14:33 -------
My relaoding comment is wrong. The app needs to be redployed (ie the work dir
cleared as pointed out in the original report). I have reverted the patch and am
working on one that handles tags in JARs.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 43741] - .tag files in a .tar recompiled for each .jsp -- extremely slow (with fix)

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43741>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43741





------- Additional Comments From markt@apache.org  2008-01-07 15:52 -------
I'd much rather fix the cause than the symptom. The proper fix for this will be
to implement the enhancement described in bug 43742.

I'll check the code to see if the JSP -> JAR dependency has been fixed (and if
it hasn't - fix it) but if you have a bug number that would save me some time.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org