Skip to content

Commit 1cbd5f1

Browse files
authored
Merge pull request #260 from danleh/readme-addendum
Extend prefetching/preloading section of the README
2 parents 687792e + 0d19533 commit 1cbd5f1

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,21 @@ The individual workloads are in subdirectories.
5454

5555
### Preloading and Compression
5656

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.
57+
**Network prefetching (in the browser).**
58+
In order to avoid the CPU frequency spinning down between tests we prefetch all assets before any of the tests start in the browser.
59+
(In the CLI/shell runner we assume all assets are on disk.)
60+
Assets are saved in a blob URL so they can be cached on disk.
61+
This lowers the peak memory footprint of the benchmark to a sustainable level.
62+
63+
**Large asset preloading.**
64+
The JetStream driver (both in the browser and shell runners) preloads some large assets and source files.
65+
This avoids extensive disk I/O during the measurement window of the workloads.
66+
67+
**Compression.**
68+
In order to limit the repository size and network transfers, large assets (e.g., ML models, heavy JavaScript bundles in the order of 10s of MBs) are stored as compressed .z files on disk.
6369
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.
6470

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).
71+
Preloading, prefetching, and compression can be disabled, e.g., to inspect raw files or because it sometimes helps with debugging (e.g., to get proper URLs instead of blob URLs for resources).
6672

6773
- Compression: Run `npm run decompress` to decompress all .z files before running the benchmark.
6874
- No prefetching for shells: Pass the `--no-prefetch` flag, e.g., `jsc cli.js -- --no-prefetch`.

0 commit comments

Comments
 (0)