You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by lu...@apache.org on 2004/10/05 21:28:20 UTC
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Compiler.java
luehe 2004/10/05 12:28:20
Modified: jasper2/src/share/org/apache/jasper/compiler Compiler.java
Log:
Determine various JSP compilation time intervals only as needed
Revision Changes Path
1.96 +18 -10 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
Index: Compiler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- Compiler.java 5 Oct 2004 07:24:33 -0000 1.95
+++ Compiler.java 5 Oct 2004 19:28:19 -0000 1.96
@@ -86,7 +86,13 @@
String[] smapStr = null;
- long t1=System.currentTimeMillis();
+ long t1, t2, t3, t4;
+
+ t1 = t2 = t3 = t4 = 0;
+
+ if (log.isDebugEnabled()) {
+ t1 = System.currentTimeMillis();
+ }
// Setup page info area
pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader(),
@@ -150,9 +156,9 @@
// Validate and process attributes
Validator.validate(this, pageNodes);
- long t2=System.currentTimeMillis();
- // Dump out the page (for debugging)
- // Dumper.dump(pageNodes);
+ if (log.isDebugEnabled()) {
+ t2 = System.currentTimeMillis();
+ }
// Collect page info
Collector.collect(this, pageNodes);
@@ -162,7 +168,9 @@
tfp = new TagFileProcessor();
tfp.loadTagFiles(this, pageNodes);
- long t3=System.currentTimeMillis();
+ if (log.isDebugEnabled()) {
+ t3 = System.currentTimeMillis();
+ }
// Determine which custom tag needs to declare which scripting vars
ScriptingVariabler.set(pageNodes, errDispatcher);
@@ -187,11 +195,11 @@
// to be GC'd and save memory.
ctxt.setWriter(null);
- long t4=System.currentTimeMillis();
- if( t4-t1 > 500 ) {
- log.debug("Generated "+ javaFileName + " total=" +
- (t4-t1) + " generate=" + ( t4-t3 ) + " validate=" +
- ( t2-t1 ));
+ if (log.isDebugEnabled()) {
+ t4 = System.currentTimeMillis();
+ log.debug("Generated "+ javaFileName + " total="
+ + (t4-t1) + " generate=" + (t4-t3)
+ + " validate=" + (t2-t1));
}
} catch (Exception e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org