How JetStream and MotionMark Benchmark Safari Performance

This article provides a comprehensive overview of how the JetStream and MotionMark benchmark suites evaluate the performance of the Safari web browser. It breaks down the exact methodologies JetStream uses to test JavaScript and WebAssembly compilation throughput, alongside how MotionMark stresses Safari's graphics rendering pipeline to measure visual fidelity and frame rate stability. By examining the internal mechanics of Safari's WebKit engine and the scoring systems of these two tools, you will understand how browser speed and graphical efficiency are accurately quantified.

JetStream: Measuring JavaScript Compilation Throughput

JetStream is a benchmark suite focused on advanced web applications that rely heavily on JavaScript and WebAssembly. In Safari, JavaScript execution is handled by the JavaScriptCore (JSC) engine, which uses a multi-tiered Just-In-Time (JIT) compilation architecture. JetStream measures compilation throughput by stressing every tier of this architecture across dozen of distinct subtests.

JavaScriptCore processes code through four main tiers:

  1. LLInt (Low-Level Interpreter): Starts executing code immediately with zero compilation delay.
  2. Baseline JIT: Compiles code quickly with minimal optimization for functions that run repeatedly.
  3. DFG (Data Flow Graph) JIT: Applies aggressive optimizations based on profiling data gathered during execution.
  4. FTL (Faster Than Light) JIT: Uses the B3 backend to compile heavily used code into highly optimized machine code.

JetStream evaluates how efficiently Safari moves code through these tiers by breaking its measurement of each workload into specific phases:

  • Startup Performance: JetStream measures the time it takes to parse, compile, and run the first iteration of a test. This directly tests the efficiency of Safari’s parser, the LLInt, and the Baseline JIT. If Safari takes too long to compile code upfront, the startup score drops.
  • Worst-Case Execution: As Safari runs the test, it decides when to promote code to the DFG and FTL compilers. This compilation happens on background threads, but it still consumes CPU resources and requires memory. JetStream measures the slowest iterations after startup to penalize "jank" or pauses caused by heavy JIT compilation throughput bottlenecks and garbage collection.
  • Average (Sustained) Performance: Once the code is fully optimized by the FTL JIT, JetStream measures the execution speed of the remaining iterations. This evaluates the raw quality of the machine code generated by Safari's highest compiler tier.

To calculate the final score, JetStream takes the geometric mean of all subtests, weighting startup, worst-case, and average performance equally. This ensures Safari cannot achieve a high score solely by having a fast optimizing compiler; it must also compile code quickly and manage memory efficiently without stalling the main thread.

MotionMark: Measuring Graphics Rendering Performance

While JetStream focuses on CPU-bound code execution, MotionMark is designed to measure a browser's graphics rendering capabilities. Safari relies on the WebKit rendering engine, which utilizes Apple's Core Animation and the Metal graphics API to offload rendering tasks to the GPU.

Unlike traditional benchmarks that run a fixed workload as fast as possible, MotionMark locks onto the display's target refresh rate—typically 60 frames per second (FPS), or 120 FPS on ProMotion displays—and measures how much visual complexity Safari can handle before the frame rate drops.

MotionMark evaluates Safari's rendering pipeline through the following methodology:

  • Diverse Rendering Subtests: The suite runs tests utilizing different web technologies, including HTML5 Canvas (2D context), SVG (Scalable Vector Graphics), and complex CSS compositing and animations. These tests draw thousands of paths, lines, gradients, and particles.
  • Dynamic Complexity Scaling: During a test, MotionMark operates in a feedback loop. It begins by rendering a simple scene with a few elements. If Safari easily maintains the target frame rate (e.g., completing each frame in under 16.67 milliseconds for a 60Hz display), MotionMark dynamically increases the number of elements on the screen. If the frame rate dips, it reduces the element count.
  • CPU-to-GPU Bottleneck Detection: By scaling the workload, MotionMark finds the exact breaking point of Safari’s rendering pipeline. In CSS and SVG tests, this often measures how fast WebKit can calculate layouts, update the Document Object Model (DOM), and build display lists on the CPU. In Canvas tests, it measures how efficiently Safari translates drawing commands into Metal API calls and how quickly the GPU can rasterize the pixels.

At the end of each subtest, MotionMark uses piecewise regression analysis on the recorded frame times versus element counts. The score for a test represents the maximum number of elements Safari can render while still maintaining a smooth, locked frame rate. The final MotionMark score is the geometric mean of all individual subtest scores.

Summary of Benchmark Roles

Together, JetStream and MotionMark provide a complete performance profile of the Safari browser. JetStream ensures that JavaScriptCore can parse, compile, and optimize complex logic with high throughput and minimal latency. MotionMark ensures that WebKit can take the visual output of that logic and render it smoothly to the screen using hardware acceleration.