!7 sS transpilerID = #1025804; //#759; p { int runs = 5; // 5 are enough for warm-up with this big source bool mediumTranspile = true; S mainJava = //[[print("hello!");]]; //loadSnippet(#759); // doesn't work, requires different transpiler loadSnippet(#1016478); // transpile the OS mainJava = dropTranslators(mainJava); S transpiled, transpiled2; new L times; bool resultsDiffer; maximizeConsole(); O transpiler = hotwireDependent(transpilerID); setAll(transpiler, useIndexedList2 := false, useTokenIndexedList := true, dontLoadCachedIncludesFromVM := true, //cacheStdFunctions := false, //cacheStdClasses := false ); time "First run" { set(transpiler, +mainJava); callMain(transpiler); transpiled = (S) get(transpiler, 'mainJava); } long time1 = lastTiming(); // Now we should have cached all the snippets, but not the pre-transpiled stuff. for (int run = 2; run <= runs; run++) { S msg = "Run " + run; if (run == runs) poorMansProfiling(); time msg { if (mediumTranspile) call(transpiler, 'forgetCachedIncludes); set(transpiler, +mainJava); callMain(transpiler); transpiled2 = (S) get(transpiler, 'mainJava); } times.add(lastTiming()); S check1 = minusLinesContaining("myTranspilationDate_value", transpiled); S check2 = minusLinesContaining("myTranspilationDate_value", transpiled2); if (neq(check1, check2)) { set resultsDiffer; print("WARNING: RESULTS DIFFER"); print(unidiff(check1, check2)); } } poorMansProfiling_stopAndPrintResults(); print("Made " + nChars(transpiled) + ", md5: " + md5(transpiled)); print("Run 1 with downloads: " + time1 + " ms"); int run = 2; for (long time : times) print("Run " + (run++) + " w/o downloads: " + time + " ms"); if (resultsDiffer) print("WARNING: RESULTS DIFFER BETWEEN RUNS"); }