Skip to content

Perf/both bench opt#33

Merged
geseq merged 3 commits into
mainfrom
perf/both-bench-opt
Jun 27, 2026
Merged

Perf/both bench opt#33
geseq merged 3 commits into
mainfrom
perf/both-bench-opt

Conversation

@geseq

@geseq geseq commented Jun 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

geseq and others added 2 commits June 22, 2026 14:13
remove() erased by key (price()), re-searching for a node already in
hand. Erase via iterator_to(*q) instead (O(1) amortized), avoiding a
redundant tree search on the cancel/fill path.

append() is left on its original find()+insert_equal() body: a
single-walk lower_bound()+hinted insert added a per-append Decimal
equality compare on the common append-to-existing-level path,
regressing the static workload.
Alternative to the template approach: replace std::function callbacks with
a non-owning function_ref<R(Args...)> (void* + static thunk, two pointers,
no alloc). Methods stay non-template and their bodies remain in the .cpp;
explicit instantiations unchanged. Removes per-order std::function
construction but keeps an indirect call on dispatch (no inlining).

Experiment branch for A/B vs the template variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0196EKKWudtsg3gButufhDxz
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

Benchmark PR

Throughput on hosted runners is noisy and not performance-calibrated; treat the numbers as informational only.

Realistic deep-book throughput (W=50000)

Metric PR main change
ops/sec 24,920,913 19,064,988 +30.7%

Matching-engine-benchmark (perf mode)

Harness pinned at 77697a115e76a25a1e2aa886f555d55b87fcf052.

Scenario PR (M msgs/s) main (M msgs/s) change PR correctness
static 8.693 8.917 -2.5% PASS
normal 9.594 8.441 +13.7% PASS
swing-25 8.818 8.037 +9.7% PASS
swing-40 9.248 8.280 +11.7% PASS
flash-crash 9.788 8.632 +13.4% PASS

Turn on interprocedural optimization (-flto) for optimized builds of the
orderbook library/main and the matching-engine benchmark adapter .so.
Gated to Release-type builds via check_ipo_supported; sanitizer and Debug
builds are unaffected. Enables cross-TU inlining of the matching chain.

Measured (12-round interleaved A/B, cores 2/4): add/cancel throughput
+42-44%; matching scenarios flat-to-positive; correctness unchanged
(all harness scenarios PASS).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0196EKKWudtsg3gButufhDxz
@geseq geseq force-pushed the perf/both-bench-opt branch from 86ea4e7 to 9e9ad2d Compare June 27, 2026 12:14
@geseq geseq merged commit 3663f47 into main Jun 27, 2026
5 checks passed
@geseq geseq deleted the perf/both-bench-opt branch June 27, 2026 12:59
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