Running v8-v7 Benchmarks in mpv Player

mpv-v8v7 is a JavaScript script for running v8-v7 benchmark tests directly inside the mpv player.

The original benchmark code comes from mozilla/arewefastyet, and has been bundled and converted into a CommonJS format compatible with mpv using ahaoboy/js-engine-benchmark.

pgo
origin

:scroll: How It Works

  1. When mpv starts, the script automatically pauses video playback.
  2. It runs the v8-v7 benchmark test.
  3. The test results are displayed on-screen via mpv’s OSD (On-Screen Display).
  4. Once completed, the results are saved to a log file: scripts/mpv-v8v7-<timestamp>.log

:light_bulb: Why Run This Benchmark?

The v8-v7 benchmark is designed to evaluate JavaScript engine performance.

  • Higher scores mean faster JavaScript execution.
  • Developers can use this test to compare the effects of different compilation options (e.g., PGO, MIMALLOC) on JS execution speed.

This makes it especially useful for performance tuning and testing custom mpv builds.

:package: Requirements

  • mpv with JavaScript scripting enabled.

:gear: Installation

  1. Download the latest portable_config.zip from:
    mpv-build

  2. Extract portable_config.zip into your local mpv directory.

  3. To avoid interference, it’s recommended to install only this script for testing purposes.

:memo: Example Output

When the benchmark runs, mpv will pause playback and display results like:

Richards: 526
DeltaBlue: 766
Crypto: 366
RayTrace: 1085
EarleyBoyer: 1300
RegExp: 513
Splay: 2380
NavierStokes: 957
----
Score: 838

The full details are stored in scripts/mpv-v8v7-<timestamp>.log.

:link: Related Projects