In Depth Analysis
JetStream combines a variety of JavaScript benchmarks, covering a variety of advanced workloads and programming techniques, and reports a single score that balances them using geometric mean.
Each benchmark measures a distinct workload, and no single optimization technique is sufficient to speed up all benchmarks. Latency tests measure that a web application can start up quickly, ramp up to peak performance quickly, and run smoothly without interruptions. Throughput tests measure the sustained peak performance of a web application, ignoring ramp-up time and spikes in smoothness. Some benchmarks demonstrate tradeoffs, and aggressive or specialized optimization for one benchmark might make another benchmark slower.
JetStream includes benchmarks from the SunSpider 1.0.2 and Octane 2 JavaScript benchmark suites. It also includes benchmarks from the LLVM compiler open source project, compiled to JavaScript using Emscripten 1.13. It also includes a benchmark based on the Apache Harmony open source project's HashMap and a port of the CDx benchmark, hand-translated to JavaScript.
These benchmarks cover both classical performance measurements — like Martin Richards's machine and language independent benchmark (richards) and the Dhrystone synthetic computing benchmark (dry.c) — and real-world examples — like the Mozilla open source project's PDF renderer (pdfjs), the Box2D JavaScript physics engine (box2d), and the jQuery and Closure JavaScript libraries (code- first-load, code-multi-load).
Note that scores from JetStream 1.1 are not comparable to scores from other versions of JetStream.
- 3d-cube
- 3D cube rotation benchmark by Simon Speich. This benchmark was previously published as part of SunSpider. The original can be found on Simon's web page. Tests arrays and floating-point math in relatively short-running code. Source code: 3d-cube.js
- 3d-raytrace
- Simple raytracer written by Oliver Hunt of the WebKit team. This benchmark was originally published in SunSpider. Tests arrays and floating-point math in relatively short-running code. Source code: 3d-raytrace.js
- base64
- Base64 encoder/decoder written in JavaScript, originally from the Mozilla XML-RPC client component. Tests string manipulation. This benchmark was previously published as part of SunSpider. Source code: base64.js
- cdjs
- JavaScript implementation of the CDx collision detection benchmark. Measures the browser's worst-case performance over 200 collision detection runs. Source code: benchmark.js, call_sign.js, collision.js, collision_detector.js, constants.js, motion.js, red_black_tree.js, reduce_collision_set.js, simulator.js, util.js, vector_2d.js, vector_3d.js
- code-first-load
- Test of code load speed of the jQuery and Closure libraries. This test attempts to defeat the browser's caching capabilities by randomizing the source code, making it representative of the first-load experience. This test was previously published in Octane version 2. Source code: code-load.js
- code-multi-load
- Test of code load speed of the jQuery and Closure libraries. Because this test allows caching, this is representative of revisiting the same website. This test was previously published in Octane version 1. Source code: code-load.js
- crypto-aes
- Advanced Encryption Standard (AES) implementation in JavaScript by Chris Veness. A newer version can be found here. Tests integer math. This benchmark was previously published as part of SunSpider. Source code: crypto-aes.js
- crypto-md5
- MD5 implementation in JavaScript by Paul Johnston and others. Tests interesting integer math idioms. This benchmark was previously published as part of SunSpider. Source code: crypto-md5.js
- crypto-sha1
- SHA-1 implementation in JavaScript by Paul Johnston and others. Tests interesting integer math idioms. This benchmark was previously published as part of SunSpider. Source code: crypto-sha1.js
- date-format-tofte
- Date and time formatting test, based on code by Svend Tofte. Involves an interesting use of
eval
and also covers string manipulation and JavaScript library functions. This benchmark was previously published as part of SunSpider. Source code: date-format-tofte.js - date-format-xparb
- Sophisticated date formatting and parsing library test, based on code by Barin Schwartz. This benchmark was previously published as part of SunSpider. Source code: date-format-xparb.js
- mandreel-latency
- Tests the Bullet physics engine's worst case performance over many iterations. The physics engine is compiled to JavaScript with Mandreel. JetStream also reports the throughput score for this test as mandreel. This benchmark was previously published in Octane version 2, but JetStream uses a different latency metric based on the average of the worst 0.5% samples. Source code: mandreel.js
- n-body
- Classic solar system simulation benchmark from The Great Computer Language Shootout, contributed by Isaac Guy. Tests math and object access performance. This benchmark was previously published in SunSpider. Source code: n-body.js
- regex-dna
- Regular-expression-based solution to DNA manipulation from The Great Computer Language Shootout, contributed by Jesse Millikan. This benchmark was previously published in SunSpider. Source code: regex-dna.js
- splay-latency
- Tests the worst-case performane of manipulating a splay tree represented using plain JavaScript objects. JetStream also reports the throughput score for this test as splay. This benchmark was previously published in Octane version 2, but JetStream uses a different latency metric based on the average of the worst 0.5% samples. Source code: splay.js
- tagcloud
- Parses JSON and generates markup for a tag cloud view of the data. Written by Maciej Stachowiak of the WebKit team. Exercises string parsing and manipulation. This benchmark was originally published in SunSpider. Source code: tagcloud.js
- typescript
- Tests how quickly Microsoft's TypeScript compiler can compile itself. This benchmark sets itself apart from the others due to its sheer size. More than anything else this tests how quickly a JavaScript runtime can optimize a large pile of code. This benchmark was previously published in Octane version 2. Source code: typescript.js, typescript-compiler.js, typescript-input.js
- bigfib.cpp
- C++ program for computing very large Fibonacci numbers using a BigInt class, compiled to JavaScript with Emscripten. Tests asm.js performance, with a focus on complex C++ data structures. The original C++ version of this benchmark was previously published in the LLVM test suite. Source code: bigfib.cpp, bigfib.cpp.js
- box2d
- The Box2D physics engine ported to JavaScript. Tests floating point math and data structures. This benchmark was previously published in Octane version 2. Source code: box2d.js
- container.cpp
- Stepanov and Stroustrup's Standard Container Benchmark compiled to JavaScript with Emscripten. Tests asm.js performance, with a focus on complex C++ data structures. The original C++ version of this benchmark was previously published in the LLVM test suite. Source code: container.cpp, container.cpp.js
- crypto
- RSA cypher implemented in JavaScript by Tom Wu. Tests integer math and arrays. This benchmark was previously published in Octane version 2. Source code: crypto.js
- delta-blue
- The classic DeltaBlue benchmark derived from a Smalltalk implementation by Maloney and Wolczko. Tests devirtualization of JavaScript code that uses an idiomatic class hierarchy construction. This benchmark was previously published in Octane version 2. Source code: deltablue.js
- dry.c
- The classic Dhrystone benchmark program by Reinhold P. Weicker, translated from Ada to C by Rick Richardson, and then compiled to JavaScript with Emscripten. Measures basic integer arithmetic in asm.js code. The original C version of this benchmark was previously published in the LLVM test suite. Source code: dry.c, dry.c.js
- earley-boyer
- Tests two classic Scheme benchmarks translated to JavaScript using scheme2js. The first benchmark is Earley, is a chart parser algorithm due to Jay Earley. The second is Boyer, a logic programming benchmark by Bob Boyer. Measures variadic functions and object construction. This benchmark was previously published in Octane version 2. Source code: earley-boyer.js
- float-mm.c
- Floating point matrix multiply benchmark, compiled to JavaScript with Emscripten. The original C version of this benchmark was previously published in the LLVM test suite. Source code: float-mm.c, float-mm.c.js
- gbemu
- Gameboy emulator written in JavaScript. Tests typed array and property access performance. This benchmark was previously published in Octane version 2. Source code: gbemu-part1.js, gbemu-part2.js
- gcc-loops.cpp
- Example loops used to tune the GCC and LLVM vectorizers, compiled to JavaScript with Emscripten. The original C++ version of this benchmark was previously published in the LLVM test suite. Source code: gcc-loops.cpp
- hash-map
- Apache Harmony java.util.HashMap implementation ported to JavaScript and benchmarked by doing 500,000 inserts, 2,500,000 queries, and then iterating the associated entrySet. Tests object-oriented JavaScript idioms and object construction. The JavaScript version of this benchmark was originally published as part of the WebKit test suite. Source code: hash-map.js
- mandreel
- Tests the Bullet physics engine's throughput. The physics engine is compiled to JavaScript with Mandreel. JetStream also reports the worst-case performance score for this test as mandreel-latency. This benchmark was previously published in Octane version 2. Source code: mandreel.js
- n-body.c
- Christoph Bauer's version of the classic solar system simulation benchmark from The Great Computer Language Shootout, written in C and compiled to JavaScript with Emscripten. The original C version of this benchmark was previously published in the LLVM test suite. Source code: n-body.c, n-body.c.js
- navier-stokes
- Fluid simulation written by Oliver Hunt of the WebKit team. Emphasizes floating point array performance. This benchmark was previously published in Octane version 2. Source code: navier-stokes.js
- pdfjs
- Mozilla's PDF reader written in JavaScript. This benchmark emphasizes array manipulation and bit operations. This benchmark was previously published in Octane version 2. Source code: pdfjs.js
- proto-raytracer
- Ray tracer written in JavaScript using prototype.js. Tests object construction performance and floating point math. This benchmark was previously published in Octane version 2. Source code: raytrace.js
- quicksort.c
- Quicksort benchmark, compiled to JavaScript with Emscripten. The original C version of this benchmark was previously published in the LLVM test suite. Source code: quicksort.c, quicksort.c.js
- regexp-2010
- Collection of regular expressions found by the V8 team in 2010, curated into a benchmark. This benchmark was previously published in Octane version 2. Source code: regexp.js
- richards
- Martin Richard's system language benchmark ported to JavaScript. Tests object property access performance. This benchmark was previously published in Octane version 2. Source code: richards.js
- splay
- Tests the throughput of manipulating a splay tree represented using plain JavaScript objects. JetStream also reports the worst-case performance score for this test as splay-latency. This benchmark was previously published in Octane version 2. Source code: splay.js
- towers.c
- Towers of Hanoi benchmark from the LLVM test suite, compiled to JavaScript with Emscripten. The original C version of this benchmark was previously published in the LLVM test suite. Source code: towers.c, towers.c.js
- zlib
- A benchmark based on compiling zlib to JavaScript using Emscripten. Based on the zlib emscripten test but modified to restrict code caching opportunities. This benchmark was previously published in Octane version 2. Source code: zlib.js, zlib-data.js