From: <dr...@us...> - 2003-06-12 00:47:56
|
Update of /cvsroot/webmacro/webmacro/test/perf In directory sc8-pr-cvs1:/tmp/cvs-serv6675/test/perf Modified Files: SpinTest.java Log Message: If this doesn't drive our SF "activity" stats through the roof, I don't know what will. Mass re-formatting of all code, following (to the best of my interpertation) the Sun (w/ jakarta tweaks) coding style guidelines defined here: http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html and here: http://jakarta.apache.org/turbine/common/code-standards.html I did this reformatting with IDEA 3.0.5, and I am going to commit the style configuration for IDEA (if I can find it). Index: SpinTest.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/perf/SpinTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SpinTest.java 4 May 2001 00:39:28 -0000 1.2 --- SpinTest.java 12 Jun 2003 00:47:49 -0000 1.3 *************** *** 1,43 **** - import java.io.*; ! import org.webmacro.*; public class SpinTest { ! public static void main(String[] args) throws Exception { ! long initStart, loopStart, loopEnd; ! String template = args[0]; ! int count = Integer.parseInt(args[1]); ! initStart = System.currentTimeMillis(); ! WM wm = new WM(); ! loopStart = System.currentTimeMillis(); ! for (int i=0; i<count; i++) { ! Context c = wm.getContext(); ! c.put("One", "1"); ! c.put("Two", "2"); ! c.put("Three", "3"); ! Template t = wm.getTemplate(template); ! FastWriter fw = new FastWriter(wm.getBroker(), new FileOutputStream("/dev/null"), "US-ASCII"); ! t.write(fw, c); ! fw.close(); ! } ! loopEnd = System.currentTimeMillis(); ! System.out.println("Total time: " ! + ((double) (loopEnd-initStart)/1000) ! + "s, loop time " ! + ((double) (loopEnd-loopStart)/1000) ! + "s, template time " ! + ((double) (loopEnd-loopStart)/count) + "ms"); ! } } --- 1,49 ---- ! import org.webmacro.Context; ! import org.webmacro.FastWriter; ! import org.webmacro.Template; ! import org.webmacro.WM; ! ! import java.io.FileOutputStream; public class SpinTest { ! public static void main (String[] args) throws Exception ! { ! long initStart, loopStart, loopEnd; ! String template = args[0]; ! int count = Integer.parseInt(args[1]); ! initStart = System.currentTimeMillis(); ! WM wm = new WM(); ! loopStart = System.currentTimeMillis(); ! for (int i = 0; i < count; i++) ! { ! Context c = wm.getContext(); ! c.put("One", "1"); ! c.put("Two", "2"); ! c.put("Three", "3"); ! Template t = wm.getTemplate(template); ! FastWriter fw = new FastWriter(wm.getBroker(), new FileOutputStream("/dev/null"), "US-ASCII"); ! t.write(fw, c); ! fw.close(); ! } ! loopEnd = System.currentTimeMillis(); ! System.out.println("Total time: " ! + ((double) (loopEnd - initStart) / 1000) ! + "s, loop time " ! + ((double) (loopEnd - loopStart) / 1000) ! + "s, template time " ! + ((double) (loopEnd - loopStart) / count) + "ms"); ! } } |