Check our work

Every number on this site comes from code you can run. The code and the raw results live in one public repository: github.com/adamzwasserman/honest-code-traces.

The program

One small program: build an order, add three items, apply a coupon, then compute the total, the discount, the tax and the grand total. We wrote it in 11 languages, as an average programmer would, with a class and separate method calls. We also wrote a version made of plain functions. Neither version is tuned for performance. The class timings leave out timestamp writes.

Tools and versions

LanguageVersionTiming tool
C++g++ 15.2.0Google Benchmark, five repetitions
JavaOpenJDK 21.0.12JMH, three forks of five one-second iterations
JavaScriptNode 22.23.3 (V8)mitata, one process per setting
PythonCPython 3.14.4, PyPy 7.3.20pyperf, ten processes of five values
RubyRuby 3.3.8benchmark-ips
PHPPHP 8.5.4the program's own loop, three runs

Everything ran in an Ubuntu 26.04 container on a rented eight-core virtual machine.

Where the data lives

The optimizer settings are in measured/optimizer-dial, and the memory layout runs are in measured/layout, measured/layout-others and measured/layout-raw. The scripts are in harness/dial, harness/layout and harness/checks. HotSpot's own log of what it inlined is in measured/optimizer-dial/inlining.

Limits

If you find a mistake, open an issue.