Feature/improvement #1
Merged
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.
Guarantee Deterministic Order Handling, Accelerate
OrderQueue, and Refresh Benchmark DocumentationDescription
This pull request consolidates several improvements that eliminate order-timestamp non-determinism, upgrade the order book’s internal data structures for faster look-ups, and publish up-to-date high-frequency-trading (HFT) benchmarks and contention analyses.
Key outcomes:
SegQueueforDashMap, enabling O(1) order retrieval and measurable throughput gains.lib.rs) now reflect the latest simulation numbers (≥ 280 k ops/s mixed workload; up to 7.75 M ops/s hot-spot writes).Changes Made
Order creation
TIMESTAMP_COUNTER(atomicu64) to generate strictly increasing timestamps.create_standard_order,create_iceberg_order, …) to consume the counter.OrderTypeconstruction logic to use the new counter automatically.Data-structure refactor
SegQueuewithDashMapinsideOrderQueuefor constant-time look-ups.format!calls to inline variables for cleaner logging.Tests
test_iter_orders: deterministic order iteration via atomic timestamps.test_price_level_from_str: switched to unique IDs (1-5) to avoid overwrites.Documentation
lib.rs:Testing
cargo test(54 suites)test_iter_ordersScreenshots / Examples
(Optional – omit if reviewers prefer smaller diff size)
Additional Notes
References
bd463f1,6352b56,b58f11b,14f920a.Checklist
cargo clippy --all-features).lib.rs).