Skip to content

Commit e89743d

Browse files
committed
Address Danleh's comments:
Build products are now built to a build subdirectory. Log the build info into build.log Fix `date` command to work on MacOS out of the box. Reduce iteration count to 15/2. Remove ZLib check since it's always false in JetStream anyway.
1 parent 9839924 commit e89743d

File tree

8 files changed

+35
-16
lines changed

8 files changed

+35
-16
lines changed

JetStreamDriver.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,13 @@ class Driver {
336336
} else
337337
globalObject = runString("");
338338

339-
globalObject.console = { log: globalObject.print, warn: (e) => { print("Warn: " + e); /*$vm.abort();*/ }, error: (e) => { print("Error: " + e); /*$vm.abort();*/ } }
339+
globalObject.console = {
340+
log: globalObject.print,
341+
warn: (e) => { print("Warn: " + e); },
342+
error: (e) => { print("Error: " + e); },
343+
debug: (e) => { print("Debug: " + e); },
344+
};
345+
340346
globalObject.self = globalObject;
341347
globalObject.top = {
342348
currentResolve,
@@ -1012,7 +1018,7 @@ class AsyncBenchmark extends DefaultBenchmark {
10121018
class WasmEMCCBenchmark extends AsyncBenchmark {
10131019
get prerunCode() {
10141020
let str = `
1015-
let verbose = true;
1021+
let verbose = false;
10161022
10171023
let globalObject = this;
10181024
@@ -1030,8 +1036,8 @@ class WasmEMCCBenchmark extends AsyncBenchmark {
10301036
let Module = {
10311037
preRun: [],
10321038
postRun: [],
1033-
print: function() { },
1034-
printErr: function() { },
1039+
print: print,
1040+
printErr: printErr,
10351041
setStatus: function(text) {
10361042
},
10371043
totalDependencies: 0,
@@ -1891,13 +1897,15 @@ const testPlans = [
18911897
{
18921898
name: "tsf-wasm",
18931899
files: [
1894-
"./wasm/TSF/tsf.js",
1900+
"./wasm/TSF/build/tsf.js",
18951901
"./wasm/TSF/benchmark.js",
18961902
],
18971903
preload: {
1898-
wasmBinary: "./wasm/TSF/tsf.wasm"
1904+
wasmBinary: "./wasm/TSF/build/tsf.wasm"
18991905
},
19001906
benchmarkClass: WasmEMCCBenchmark,
1907+
iterations: 15,
1908+
worstCaseCount: 2,
19011909
testGroup: WasmGroup
19021910
},
19031911
{
@@ -1943,7 +1951,7 @@ const testPlans = [
19431951
preload: {
19441952
wasmBinary: "./sqlite3/build/jswasm/speedtest1.wasm"
19451953
},
1946-
benchmarkClass: WasmBenchmark,
1954+
benchmarkClass: WasmLegacyBenchmark,
19471955
testGroup: WasmGroup
19481956
},
19491957
{

sqlite3/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ rm sqlite-src-*.zip
88
rm -rf sqlite-src-*/
99
rm -rf build/
1010

11+
touch build.log
1112
BUILD_LOG="$(realpath build.log)"
12-
echo -e "Built on $(date --rfc-3339=seconds)\n" | tee "$BUILD_LOG"
13+
echo -e "Built on $(date -u '+%Y-%m-%dT%H:%M:%SZ')\n" | tee "$BUILD_LOG"
1314

1415
echo "Toolchain versions" | tee -a "$BUILD_LOG"
1516
emcc --version | head -n1 | tee -a "$BUILD_LOG"

wasm/TSF/build.log

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Built on 2024-12-20T14:36:37Z
2+
3+
Toolchain versions
4+
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.73-git
5+
Building...
6+
Building done

wasm/TSF/build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
set -euo pipefail
44

5+
touch build.log
6+
BUILD_LOG="$(realpath build.log)"
7+
echo "Built on $(date -u '+%Y-%m-%dT%H:%M:%SZ')\n" | tee "$BUILD_LOG"
8+
9+
echo "Toolchain versions" | tee -a "$BUILD_LOG"
10+
emcc --version | head -n1 | tee -a "$BUILD_LOG"
11+
12+
echo "Building..." | tee -a "$BUILD_LOG"
13+
mkdir -p build
514
emcc \
6-
-o tsf.js -O2 -s MODULARIZE=1 -s EXPORT_NAME=setupModule -s WASM=1 -s TOTAL_MEMORY=52428800 -g1 --emit-symbol-map -s EXPORTED_FUNCTIONS=_runIteration \
15+
-o build/tsf.js -O2 -s MODULARIZE=1 -s EXPORT_NAME=setupModule -s WASM=1 -s TOTAL_MEMORY=52428800 -g1 --emit-symbol-map -s EXPORTED_FUNCTIONS=_runIteration \
716
-I. -DTSF_BUILD_SYSTEM=1 \
817
tsf_asprintf.c\
918
tsf_buffer.c\
@@ -56,3 +65,4 @@ emcc \
5665
tsf_ir_different.c\
5766
tsf_ir_speed.c
5867

68+
echo "Building done" | tee -a "$BUILD_LOG"
File renamed without changes.
File renamed without changes.
Binary file not shown.

wasm/TSF/tsf_ir_speed.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,7 @@ int runIteration(unsigned count) {
330330
TIMEIT(readMallocTest(filename, count));
331331
TIMEIT(readConvertTest(filename, count));
332332

333-
// TODO: tsf_zlib_supported is false so we should just remove this?
334-
if (tsf_zlib_supported()) {
335-
TIMEIT(writeTest(zipFilename, 100, count, TSF_ZIP_ZLIB));
336-
TIMEIT(readTest(zipFilename, count));
337-
TIMEIT(readMallocTest(filename, count));
338-
TIMEIT(readConvertTest(zipFilename, count));
339-
}
333+
/* We don't benchmark zlib because it's not supported in JetStream */
340334

341335
/* We don't benchmark bzip2 because it's just too slow to be interesting. */
342336

0 commit comments

Comments
 (0)