Skip to content
Myr

Document the new JSON export format in the changelog (#985)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* docs: document JSON schema v2 breaking changes * docs: simplify JSON example introduction * Update `--export-json` to schema version 2 Updated the JSON format for `--export-json` to schema version 2, which now includes metadata, per-run measurements, and statistical summaries. Consumers must update their code to accommodate the new structure. * Revise breaking changes in CHANGELOG Updated breaking changes section to clarify command execution and JSON export format.

authored by David Peter · committed by GitHub · parent e262cd6 · Browse files · 1 file+44 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+44 added−2 removed

  • other:+44 added−2 removed

1 file+44 added−2 removed

modified:CHANGELOG.md+44 added-2 removed
1# Unreleased23## Breaking changes45- Execute commands directly by default (`--shell=none`). Use `-S` (an alias for `--shell=default`) to restore the previous behavior (`sh` on Unix, `cmd.exe` on Windows), or select a shell with `--shell <SHELL>`.6- Repurpose `-S` as an alias for `--shell=default`. It no longer accepts a shell argument; replace `-S <SHELL>` with `--shell <SHELL>`.5- Benchmarked commands are now always executed directly, without an intermediate shell (`--shell=none`). Use `-S` (an alias for `--shell=default`) to restore the previous behavior (`sh` on Unix, `cmd.exe` on Windows), or select a shell with `--shell <SHELL>`.6- The JSON format for `--export-json` has changed (schema version 2). The new format now includes metadata, per-run measurements, and statistical summaries for all measured quantities, see #790 (@sharkdp). Code that reads those exported JSON files must be updated. For example, `results[i].mean` is now `results[i].summary.time_wall_clock.mean`, and `results[i].times` is replaced by `results[i].measurements[j].time_wall_clock.value`. The new structure looks like this:78 ```python9 {10 "schema_version": 2,11 "metadata": {12 "hyperfine_version": "1.21.0",13 "start_time": "2026-10-06T12:00:00Z",14 "platform": {"os": "Linux", "architecture": "x86_64"}15 },16 "results": [17 {18 "command": "sleep 1", # Actual command after parameter substitution19 "name": "wait 1s", # Optional custom name, separate from the command20 "parameters": {"duration": {"value": "1"}}, # Values are now objects21 "measurements": [ # One entry per run, excluding warmups22 {23 "time_wall_clock": {"value": 1.0, "unit": "second"},24 "time_user": {"value": 0.0, "unit": "second"},25 "time_system": {"value": 0.0, "unit": "second"},26 "memory_peak_resident": {"value": 1048576.0, "unit": "byte"},27 "exit_code": 028 },29 ... # Further runs omitted30 ],31 "summary": {32 "time_wall_clock": {33 "unit": "second",34 "count": 2,35 "mean": 1.0,36 "stddev": 0.0,37 "median": 1.0,38 "min": 1.0,39 "max": 1.040 }41 # Other metrics have the same summary structure.42 }43 }44 ]45 }46 ```4748 Times are always exported in seconds and memory in bytes.4950# v1.21.05152## Features53
452 unmodified lines