Skip to content

Commit 687792e

Browse files
authored
Merge pull request #258 from danleh/repo-readme
Add initial README with some setup and runner instructions
2 parents 1dbb861 + ff781d0 commit 687792e

File tree

5 files changed

+105
-25
lines changed

5 files changed

+105
-25
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# What is JetStream?
2+
3+
JetStream 3 is a JavaScript and WebAssembly benchmark suite.
4+
For more information see the index and in-depth pages of the deployed benchmark.
5+
6+
A preview of the current main branch is available at [https://webkit-jetstream-preview.netlify.app/](https://webkit-jetstream-preview.netlify.app/).
7+
8+
<img src="./resources/screenshot.png">
9+
10+
## Open Governance
11+
12+
See [Governance.md](Governance.md) for more information.
13+
14+
## Getting Started, Setup Instructions
15+
16+
- Install Node.js and (optionally) [jsvu](https://github.com/GoogleChromeLabs/jsvu) for conveniently getting recent builds of engine shells.
17+
- `npm install` the necessary dependencies.
18+
- `npm run server` for starting a local development server, then browse to http://localhost:8010.
19+
- `npm run test:shell` for running the benchmark in engine shells, or alternatively running directly, e.g., via `jsc cli.js`.
20+
21+
See [package.json](package.json) and [.github/workflows/test.yml](.github/workflows/test.yml) for more details and available commands.
22+
23+
### Shell Runner
24+
25+
For the shell runner, see the available options by passing `--help` to `cli.js`. (Note that this requires `--` for JavaScriptCore and V8 to separate VM arguments from script arguments.):
26+
27+
```
28+
$ v8 cli.js -- --help
29+
JetStream Driver Help
30+
31+
Options:
32+
--help Print this help message.
33+
--iteration-count Set the default iteration count.
34+
...
35+
36+
Available tags:
37+
all
38+
...
39+
40+
Available tests:
41+
8bitbench-wasm
42+
...
43+
```
44+
45+
### Browser Runner
46+
47+
The browser version also supports passing parameters as URL query parameters, e.g., pass the `test` parameter (aliases are `tests` or `testList`) with a comma-separated list to run only specific workloads: [https://webkit-jetstream-preview.netlify.app/?test=8bitbench-wasm,web-ssr](https://webkit-jetstream-preview.netlify.app/?test=8bitbench-wasm,web-ssr).
48+
See [utils/params.js](utils/params.js) and [JetStreamDriver.js](JetStreamDriver.js) for more details.
49+
50+
## Technical Details
51+
52+
The main file of the benchmark harness is `JetStreamDriver.js`, which lists the individual workloads and their parameters, implements measurement and scoring, etc.
53+
The individual workloads are in subdirectories.
54+
55+
### Preloading and Compression
56+
57+
The JetStream driver (both in the browser and shell runners) _preloads_ some large assets and source files.
58+
That is, it reads those files from disk or fetches them from the network before running the workloads.
59+
This is in order to exclude network latency and disk I/O from the benchmark measurements and reduce variance. Otherwise, OS scheduling or CPU frequency scaling may affect the measurement.
60+
61+
Some workloads also utilize large assets (e.g., ML models, heavy JavaScript bundles in the order of 10s of MBs).
62+
In order to limit the repository size and network transfers, such large assets are stored as compressed .z files.
63+
Preloading handles the decompression of these assets (using `DecompressionStream` or a Wasm-based zlib polyfill) upfront so that decompression overhead does not affect the benchmark score.
64+
65+
Both preloading and compression can be disabled, e.g., to inspect raw files or because it sometimes helps with debugging (e.g., proper URLs instead of Blobs for resources).
66+
67+
- Compression: Run `npm run decompress` to decompress all .z files before running the benchmark.
68+
- No prefetching for shells: Pass the `--no-prefetch` flag, e.g., `jsc cli.js -- --no-prefetch`.
69+
- No prefetching in browsers: Append the query parameter `?prefetchResources=false` to the URL.
70+
71+
See `JetStreamDriver.js` and `utils/compress.mjs` for more details.
72+
73+
### Score Calculation
74+
75+
Scores in JetStream are dimensionless floats, where a higher score is better.
76+
When scores are aggregated (e.g., multiple sub-scores for each workload, or to determine the total score of the full benchmark suite), we use the [geometric mean](https://en.wikipedia.org/wiki/Geometric_mean).
77+
The geometric mean ensures that a multiplicative improvement of any individual score has the same effect on the aggregated score, regardless of the absolute value of the individual score.
78+
For example, an improvement by 5% of the sub score of benchmark A has the same effect on the total score as an improvement by 5% of the sub score of benchmark B.
79+
80+
See the [in-depth.html](https://webkit-jetstream-preview.netlify.app/in-depth.html) and `JetStreamDriver.js` for more details.

in-depth.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<title>JetStream 3 In-Depth Analysis</title>
3131

32-
<link rel="stylesheet" href="ressources/JetStream.css">
32+
<link rel="stylesheet" href="resources/JetStream.css">
3333

3434
</head>
3535
<body class="overflow-scroll">
@@ -43,7 +43,7 @@ <h1 class="logo">
4343
<h2>In-Depth Analysis</h2>
4444

4545
<p>
46-
JetStream 3 combines together a variety of JavaScript and Web Assembly benchmarks, covering a variety of
46+
JetStream 3 combines together a variety of JavaScript and WebAssembly benchmarks, covering a variety of
4747
advanced workloads and programming techniques, and reports a single score that
4848
balances them using a geometric mean.
4949
</p>
@@ -56,9 +56,11 @@ <h2>In-Depth Analysis</h2>
5656
</p>
5757

5858
<p>
59-
Each benchmark in JetStream 3 computes its own individual score. JetStream 3 weighs each
60-
benchmark equally, taking the geometric mean over each individual benchmark's score to compute
61-
the overall JetStream 3 score.
59+
Each benchmark in JetStream 3 computes its own individual score.
60+
Scores in JetStream are dimensionless floats, where a higher score is better.
61+
JetStream weighs each benchmark equally, taking the <a href="https://en.wikipedia.org/wiki/Geometric_mean">geometric mean</a> over each individual benchmark's score to compute the overall JetStream 3 score.
62+
The geometric mean ensures that a multiplicative improvement of any individual score has the same effect on the aggregated score, regardless of the absolute value of the individual score.
63+
For example, an improvement by 5% of the sub score of benchmark A has the same effect on the total score as an improvement by 5% of the sub score of benchmark B.
6264
</p>
6365

6466
<p>
@@ -70,7 +72,7 @@ <h2>In-Depth Analysis</h2>
7072
</p>
7173

7274
<p>
73-
For most of the JavaScript benchmarks in JetStream 3, individual scores
75+
For most of the JavaScript and WebAssembly benchmarks in JetStream 3, individual scores
7476
equally weigh startup performance, worst case performance, and average case
7577
performance. These three metrics are crucial to running performant JavaScript
7678
in the browser. Fast startup times lead browsers to loading pages more quickly. Good
@@ -79,11 +81,10 @@ <h2>In-Depth Analysis</h2>
7981
</p>
8082

8183
<p>
82-
For JetStream 3's Web Assembly benchmarks, individual scores equally weigh startup time and
83-
total execution time. An important component of JetStream 1 were the asm.js subset of benchmarks. With the release
84-
of Web Assembly, the importance of asm.js has lessened since many users of asm.js are
85-
now using Web Assembly. JetStream 3 has converted many of the asm.js benchmarks from
86-
JetStream 1 into Web Assembly.
84+
An important component of JetStream 1 were the asm.js subset of benchmarks. With the release
85+
of WebAssembly, the importance of asm.js has lessened since many users of asm.js are
86+
now using WebAssembly. JetStream 3 has converted many of the asm.js benchmarks from
87+
JetStream 1 into WebAssembly.
8788
</p>
8889

8990
<p>
@@ -106,14 +107,13 @@ <h2>In-Depth Analysis</h2>
106107
<p>
107108
JetStream 3 includes parts of these benchmark suites that came before it: <a href="https://webkit.org/perf/sunspider/sunspider.html">SunSpider</a>,
108109
<a href="https://developers.google.com/octane/">Octane 2</a>, <a href="https://browserbench.org/JetStream1.1/">JetStream 1</a>,
109-
<a href="https://browserbench.org/ARES-6/">ARES-6</a>, and <a href="https://v8.github.io/web-tooling-benchmark/">Web Tooling Benchmark</a>.
110-
JetStream 3 also includes new benchmarks inspired by <a href="https://krakenbenchmark.mozilla.org">Kraken</a>.
111-
JetStream 3 also includes a new set of benchmarks that measure the performance of Web Assembly, Web Workers,
110+
<a href="https://browserbench.org/ARES-6/">ARES-6</a>, <a href="https://v8.github.io/web-tooling-benchmark/">Web Tooling Benchmark</a>, and benchmarks inspired by <a href="https://krakenbenchmark.mozilla.org">Kraken</a>.
111+
JetStream 3 also includes a new set of benchmarks that measure the performance of WebAssembly, Web Workers,
112112
Promises, async iteration, unicode regular expressions, and JavaScript parsing.
113113
</p>
114114

115115
<p>
116-
JetStream 3 runs the same benchmarks as JetStream 3, but updates the benchmark driver to
116+
JetStream 3 includes several benchmarks from earlier JetStream versions, but updates the benchmark driver to
117117
improve score stability. This is achieved by pre-fetching network resources prior to running
118118
the benchmarks. This can reduce perturbations on the measurement of JavaScript execution
119119
time due to second order effects of pause times induced by network latency.
@@ -168,7 +168,7 @@ <h3>
168168
<dt id="tsf-wasm">tsf-wasm</dt>
169169
<dd>
170170
Runs Filip Pizlo's &mdash; of the WebKit team &mdash; implementation of a <a href="http://www.filpizlo.com/tsf/"> Typed Stream Format </a>
171-
in Web Assembly. The original code is compiled from C to Web Assembly using <a href="https://emscripten.org">Emscripten</a>.
171+
in WebAssembly. The original code is compiled from C to WebAssembly using <a href="https://emscripten.org">Emscripten</a>.
172172
Source code: <a href="wasm/TSF">TSF</a>
173173
</dd>
174174

@@ -179,7 +179,7 @@ <h3>
179179

180180
<dt id="argon2-wasm">argon2-wasm</dt>
181181
<dd>
182-
Tests <a href="https://github.com/P-H-C/phc-winner-argon2">Argon2</a>, a password-hashing function (the winner of Password Hashing Competition), in Web Assembly. This is test is based on <a href="https://github.com/antelle/argon2-browser">argon2-browser</a> library. Source code: <a href="wasm/">ARGON2</a>.
182+
Tests <a href="https://github.com/P-H-C/phc-winner-argon2">Argon2</a>, a password-hashing function (the winner of Password Hashing Competition), in WebAssembly. This is test is based on <a href="https://github.com/antelle/argon2-browser">argon2-browser</a> library. Source code: <a href="wasm/">ARGON2</a>.
183183
</dd>
184184

185185
<dt id="tagcloud-SP">tagcloud-SP</dt>
@@ -246,8 +246,8 @@ <h3>
246246
<dt id="richards-wasm">richards-wasm</dt>
247247
<dd>
248248
Martin Richard's <a href="http://www.cl.cam.ac.uk/~mr10/Bench.html">system language
249-
benchmark</a> compiled to a hybrid of Web Assembly and JavaScript. It stresses how quickly
250-
JavaScript can call into Web Assembly code.
249+
benchmark</a> compiled to a hybrid of WebAssembly and JavaScript. It stresses how quickly
250+
JavaScript can call into WebAssembly code.
251251
Source code: <a href="wasm/richards.c">richards.c</a>, <a href="wasm/richards.js">richards.js</a>
252252
</dd>
253253

@@ -302,7 +302,7 @@ <h3>
302302

303303
<dt id="quicksort-wasm">quicksort-wasm</dt>
304304
<dd>
305-
Quicksort benchmark, compiled to Web Assembly with <a href="https://emscripten.org">Emscripten</a>.
305+
Quicksort benchmark, compiled to WebAssembly with <a href="https://emscripten.org">Emscripten</a>.
306306
The original C version of this benchmark was previously published in the LLVM test suite.
307307
Source code: <a href="wasm/quicksort.c">quicksort.c</a>, <a href="wasm/quicksort.js">quicksort.js</a>
308308
</dd>
@@ -418,8 +418,8 @@ <h3>
418418

419419
<dt id="HashSet-wasm">HashSet-wasm</dt>
420420
<dd>
421-
A Web Assembly benchmark replaying a set of hash table operations performed in WebKit when loading
422-
a web page. This benchmark was compiled from C++ to Web Assembly using <a href="https://emscripten.org">Emscripten</a>.
421+
A WebAssembly benchmark replaying a set of hash table operations performed in WebKit when loading
422+
a web page. This benchmark was compiled from C++ to WebAssembly using <a href="https://emscripten.org">Emscripten</a>.
423423
Source code: <a href="wasm/HashSet.cpp">HashSet.cpp</a>, <a href="wasm/HashSet.js">HashSet.js</a>
424424
</dd>
425425

@@ -434,7 +434,7 @@ <h3>
434434

435435
<dt id="gcc-loops-wasm">gcc-loops-wasm</dt>
436436
<dd>
437-
Example loops used to tune the GCC and LLVM vectorizers, compiled to Web Assembly with
437+
Example loops used to tune the GCC and LLVM vectorizers, compiled to WebAssembly with
438438
<a href="https://emscripten.org">Emscripten</a>. The original C++ version of this benchmark was previously published in the LLVM test suite.
439439
Source code: <a href="wasm/gcc-loops.cpp">gcc-loops.cpp</a>, <a href="wasm/gcc-loops.js">gcc-loops.js</a>
440440
</dd>

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ <h1 class="logo">
9797
</h1>
9898

9999
<main>
100-
<p class="summary">JetStream 3 is a JavaScript and WebAssembly benchmark suite focused on the most advanced web applications. It rewards browsers that start up quickly, execute code quickly, and run smoothly. For more information, read the <a href="resources/in-depth.html">in-depth analysis</a>. Bigger scores are better.</p>
100+
<p class="summary">JetStream 3 is a JavaScript and WebAssembly benchmark suite focused on the most advanced web applications. It rewards browsers that start up quickly, execute code quickly, and run smoothly. For more information, read the <a href="/in-depth.html">in-depth analysis</a>. Bigger scores are better.</p>
101101
<div id="non-default-params">
102102
<h2>Non-standard Parameters</h2>
103103
<p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"prepare": "node utils/version-check.mjs",
1919
"server": "npm run prepare --silent && node tests/server.mjs",
2020
"compress": "npm run prepare --silent && node utils/compress.mjs",
21-
"decompress": "npm run prepare --silent && node utils/compress.mjs --decompress --keep ",
21+
"decompress": "npm run prepare --silent && node utils/compress.mjs --decompress --keep",
2222
"lint:check": "npm run prepare --silent && eslint **/*.{js,mjs,jsx,ts,tsx}",
2323
"pretty:check": "npm run prepare --silent && prettier --check ./",
2424
"pretty:format": "npm run prepare --silent && prettier --write ./",

resources/screenshot.png

114 KB
Loading

0 commit comments

Comments
 (0)