tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Arvesen" <>
Subject RE: jspc -compiler switch
Date Mon, 15 Apr 2002 20:03:50 GMT
Hello Flamers,
	Here is a diff of from the tomcat install I have vs CVS; sorry if it doesn't meet
your spec, but since you guys were too busy flaming one another about ant vs. make to respond
to my mail I just winged it.
	Also, I've included the simple NewerCompiler class.

	The diff is huge and mostly non-significant.  FWIW the relevant lines are at or around 448,
1156, and 1522 of the diff file.

-----Original Message-----
From: Alan Arvesen 
Sent: Wednesday, April 10, 2002 2:12 PM
Subject: jspc -compiler switch

Hello Dev,

	<flame off> 
	I've read the posting guidelines for the list, the submission guidelines for jakarta,  and
the archives for the tomcat-dev.  I'm still not quite sure of sending in a diff for my change,
etc.  Please be kind :)
	</flame off>

We've been using the jspc code shipped with tomcat for a few months now.  Over time, our code
base has grown large enough for it to be irritating to recompile from scratch each time (5
minutes on my old PII at home).  One of the long processes was that jspc would recompile every
jsp file each time.
	I grepped through the code and saw that Compiler was subclassable (in particular, the isOutDated
method is what I was interested in), but that JspC was hard coded to always call the CommandLineCompiler
class.  To get around this, I've done two things:

1)  added a -compiler switch to JspC that takes a class name as an argument 
2)  written a very simple NewerCompiler class that compares the last modified date (as reported
by for the .jsp file and the resultant .java file.

Results have been excellent:  an incremental compile will now take 40 seconds on a machine
that takes 3 minutes 4 seconds for a full compile.  The new class does not try to anything
sophisticated about dependency checking, etc.  At worst, we just do a clean install to force
all the .jsps to recompile.

I read through the tomcat mailing lists and didn't see that anyone had addressed this (that
is, plugging in a new compiler into jspc).  I don't want to duplicate anything and I also
don't want to bloat the code base with non-needed features :)  What does the mailing list
think?  Is this is useful mod?

Thanks for your time,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message