Perf/both bench opt#33
Merged
Merged
Conversation
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
Benchmark PRThroughput on hosted runners is noisy and not performance-calibrated; treat the numbers as informational only. Realistic deep-book throughput (W=50000)
Matching-engine-benchmark (perf mode)Harness pinned at
|
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
86ea4e7 to
9e9ad2d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.