parentLog.add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
private WtNode timedUnzipAndDeserialize( SerializationMethod method, byte[] serialized) throws IOException, ClassNotFoundException { if (!quiet) { for (int i = 0; i < warumpIterations; ++i) unzipAndDeserialize(method, serialized); watch.start(); for (int i = 0; i < measurementIterations; ++i) unzipAndDeserialize(method, serialized); watch.stop(); long time = watch.getElapsedTime() / measurementIterations; System.out.println("Timed unzip and deserialize:"); System.out.format(" Average time: %d ms\n", time); System.out.println(); } return unzipAndDeserialize(method, serialized); }
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
private byte[] timedSerialization(SerializationMethod method) throws IOException, ParseException { if (!quiet) { for (int i = 0; i < warumpIterations; ++i) serialize(method); watch.start(); for (int i = 0; i < measurementIterations; ++i) serialize(method); watch.stop(); } byte[] serialized = serialize(method); if (!quiet) { long time = watch.getElapsedTime() / measurementIterations; long pow = serialized.length * 100 / wikitextLength; System.out.println("Timed serialization:"); System.out.format(" Average time: %d ms\n", time); System.out.format(" Serialized size: %d Bytes\n", serialized.length); System.out.format(" Inflation: %3d%%\n", pow); System.out.println(); } return serialized; }
parentLog.add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
private WtNode timedDeserialization( SerializationMethod method, byte[] serialized) throws ClassNotFoundException, IOException { if (!quiet) { for (int i = 0; i < warumpIterations; ++i) deserialize(method, serialized); watch.start(); for (int i = 0; i < measurementIterations; ++i) deserialize(method, serialized); watch.stop(); } WtNode deserialized = deserialize(method, serialized); if (!quiet) { long time = watch.getElapsedTime() / measurementIterations; System.out.println("Timed deserialization:"); System.out.format(" Average time: %d ms\n", time); System.out.println(); } return deserialized; }
parentLog.add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
private byte[] timedZip(byte[] serialized) throws IOException { if (!quiet) { for (int i = 0; i < warumpIterations; ++i) zip(serialized); watch.start(); for (int i = 0; i < measurementIterations; ++i) zip(serialized); watch.stop(); } byte[] zipped = zip(serialized); if (!quiet) { long time = watch.getElapsedTime() / measurementIterations; long pou = serialized.length * 100 / zipped.length; long pow = wikitextLength * 100 / zipped.length; System.out.println("Timed zip:"); System.out.format(" Average time: %d ms\n", time); System.out.format(" Zipped size: %d Bytes\n", zipped.length); System.out.format(" Compression ratio serialized to serialized zipped: %3d%%\n", pou); System.out.format(" Compression ratio wikitext to serialized zipped: %3d%%\n", pow); System.out.println(); } return zipped; }
parentLog.add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
private WtNode parse(String title, String content) throws IOException, ParseException { if (!quiet && timeParsing) { for (int i = 0; i < warumpIterations; ++i) doParse(title, content); watch.start(); for (int i = 0; i < measurementIterations; ++i) original = doParse(title, content); watch.stop(); float time = watch.getElapsedTime() / (float) measurementIterations; float len = content.getBytes().length; float tp = len / 1024.f / 1024.f / (time / 1000.f); System.out.println(" Parser settings:"); System.out.println(" Warnings enabled : " + parserWarningsEnabled); System.out.println(" RTD enabled : " + parserRtdEnabled); System.out.println(" Auto correct enabled : " + parserAutoCorrectEnabled); System.out.println(" Strip all attributes : " + ppStripAllAttributes); System.out.println(" Strip RTD attributes : " + ppStripRtdAttributes); System.out.println(" Strip locations : " + ppStripLocations); System.out.println(" Simplify AST : " + ppSimplifyAst); System.out.println(); System.out.println(String.format(" Time: %d ms", (long) time)); System.out.println(String.format(" Throughput: %1.2f MB/s", tp)); } return doParse(title, content); }
parentLog.add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
parentLog.add(log); StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());
StopWatch stopWatch = new StopWatch(); stopWatch.start(); stopWatch.stop(); log.setTimeNeeded(stopWatch.getElapsedTime());
if (timingEnabled) stopWatch = new StopWatch(); stopWatch.start(); log.setTimeNeeded(stopWatch.getElapsedTime());