Skip to content

docs: compare all ten BENCH_SPEC rows against the C corelib - #115

Merged
Andste82 merged 1 commit into
mainfrom
docs/compare-all-ten-callgrind-rows
Aug 10, 2026
Merged

Andste82 merged 1 commit into
mainfrom
docs/compare-all-ten-callgrind-rows

Conversation

@Andste82

Copy link
Copy Markdown
Member

corelib-c-cpp now publishes Callgrind figures for the full BENCH_SPEC suite, so the head-to-head table in ## Benchmarks no longer has to stop at four rows and park the other six in a this-port-only table captioned "no C figures exist for them yet".

What changed

One ten-row comparison instead of two tables. The six rows that had no counterpart (blob 1MB ×3, composite ×3) move into the head-to-head table.

The C column was stale in every row it already had and is refreshed from corelib-c-cpp's current published table:

Workload C, was C, now
encode: u64 array (1000) 124 992 125 999
encode: typical message 908 966
decode: u64 array (1000) 289 941 300 432
decode: typical message 2 057 2 109

Percentages are recomputed against it (encode: typical −75 % → −77 %, decode: typical −38 % → −40 %).

"Wins across the board" is no longer true, and the README now says so. On encode: blob 1MB streaming the C core needs 1.3× fewer instructions (10 004 819 against 13 009 127): it has no memcpy fast path to fall out of, so streaming costs it what the one-shot write cost (+0.05 %), while this port falls back to a byte-at-a-time loop the moment a run stops fitting the output buffer and pays 13× its own one-shot figure. The row is called out explicitly, with what would close it (a bounded memcpy per flush window), and the wins it does have are bounded at 1.4×–10× rather than left open.

Drive-by fix. The feature table's decode-model row still advertised "In place over caller buffer, views into it". There has been no borrowing destination since read(std::string_view&) was dropped in f688cf3 — as this same README states under Memory handling. It now says each value is copied out before feed() returns.

Provenance of the numbers

The this (pure C++20) column is unchanged and reproduces exactly on the current tree (bash bench/run_callgrind.sh, all ten rows). The C and C++ wrapper columns are corelib-c-cpp's published reading, taken on its machine with the same script — the README now states that split instead of implying one joint run. Mixing them is legitimate precisely because Ir/op depends on the executed code and not the host, which is the reason both ports quote it.

ctest -R test_readme_structure passes (all CORELIB_PLAN §9 checks). No code changed.

🤖 Generated with Claude Code

corelib-c-cpp now publishes Callgrind figures for the full BENCH_SPEC suite,
so the head-to-head table no longer has to stop at four rows and park the
other six in a this-port-only table with "no C figures exist for them yet".

Merge the two into one ten-row comparison, and refresh the C column, which
was stale in every row it already had (124 992 -> 125 999, 908 -> 966,
289 941 -> 300 432, 2 057 -> 2 109). Percentages are recomputed against it.

The merged table contradicts a claim the old one supported: this port does
not win "across the board". On encode: blob 1MB streaming the C core needs
1.3x fewer instructions, because it has no memcpy fast path to fall out of
when a run stops fitting the output buffer, while this port falls back to a
byte-at-a-time loop and pays 13x its own one-shot figure. Say so explicitly,
name what would close it, and bound the wins it does have at 1.4x to 10x.

Also fix the decode-model row of the feature table, which still advertised
"views into" the caller's buffer. There is no borrowing destination since
read(std::string_view&) was dropped in f688cf3, as this README already says
under Memory handling.

The this-port column is unchanged and reproduces on the current tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Andste82
Andste82 merged commit 4dc7d85 into main Aug 10, 2026
9 checks passed
@Andste82
Andste82 deleted the docs/compare-all-ten-callgrind-rows branch August 10, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant