Skip to content

Commit 0b4dd86

Browse files
committed
Convert gcc-loops to JS-style scoring
Build with the same options (-O2, Emscripten MODULARIZE, etc.) as TSF-wasm before. Use the WasmEMCCBenchmark class introduced earlier. Since we want to run multiple iterations (for first, average, worst scoring), change to small workload size. Each individual iteration still runs >20ms, which we agreed on in the last sync. Drive-by fixes: The WasmEMCCBenchmark setup code needs to make sure we don't automatically run main() after setupModule(). The TSF-wasm build script uses `set -o pipefail`, which is a bash option, hence change shebang line. Add Wall time output also for WasmEMCCBenchmark and WasmLegacyBenchmark.
1 parent 4e888f5 commit 0b4dd86

File tree

11 files changed

+4262
-5456
lines changed

11 files changed

+4262
-5456
lines changed

JetStreamDriver.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ class WasmEMCCBenchmark extends AsyncBenchmark {
10361036
let Module = {
10371037
preRun: [],
10381038
postRun: [],
1039+
noInitialRun: true,
10391040
print: print,
10401041
printErr: printErr,
10411042
setStatus: function(text) {
@@ -1350,11 +1351,12 @@ class WasmLegacyBenchmark extends Benchmark {
13501351

13511352
console.log(" Startup:", uiFriendlyNumber(this.startupTime));
13521353
console.log(" Run time:", uiFriendlyNumber(this.runTime));
1354+
console.log(" Score:", uiFriendlyNumber(this.score));
13531355
if (RAMification) {
13541356
console.log(" Current Footprint:", uiFriendlyNumber(this.currentFootprint));
13551357
console.log(" Peak Footprint:", uiFriendlyNumber(this.peakFootprint));
13561358
}
1357-
console.log(" Score:", uiFriendlyNumber(this.score));
1359+
console.log(" Wall time:", uiFriendlyDuration(new Date(this.endTime - this.startTime)));
13581360
}
13591361
};
13601362

@@ -1922,12 +1924,14 @@ const testPlans = [
19221924
{
19231925
name: "gcc-loops-wasm",
19241926
files: [
1925-
"./wasm/gcc-loops.js"
1927+
"./wasm/gcc-loops/build/gcc-loops.js",
1928+
"./wasm/gcc-loops/benchmark.js",
19261929
],
19271930
preload: {
1928-
wasmBinary: "./wasm/gcc-loops.wasm"
1931+
wasmBinary: "./wasm/gcc-loops/build/gcc-loops.wasm"
19291932
},
1930-
benchmarkClass: WasmLegacyBenchmark,
1933+
benchmarkClass: WasmEMCCBenchmark,
1934+
iterations: 50,
19311935
testGroup: WasmGroup
19321936
},
19331937
{

wasm/TSF/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -euo pipefail
44

55
touch build.log
66
BUILD_LOG="$(realpath build.log)"
7-
echo "Built on $(date -u '+%Y-%m-%dT%H:%M:%SZ')\n" | tee "$BUILD_LOG"
7+
echo "Built on $(date -u '+%Y-%m-%dT%H:%M:%SZ')" | tee "$BUILD_LOG"
88

99
echo "Toolchain versions" | tee -a "$BUILD_LOG"
1010
emcc --version | head -n1 | tee -a "$BUILD_LOG"

0 commit comments

Comments
 (0)