Skip to content

stream trades through a sink instead of allocating them in the report - #1

Merged
ilyapt merged 3 commits into
mainfrom
trade-sink
Oct 22, 2026
Merged

ilyapt merged 3 commits into
mainfrom
trade-sink

Conversation

@ilyapt

@ilyapt ilyapt commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner
scenario before, ns/op after, ns/op allocs/op before → after
rest on an existing level + cancel 20 15 0 → 0
rest on a new level + cancel 70 64 0 → 0
fill one maker + replenish 36 23 1 → 0
sweep 10 makers + replenish 356 237 5 → 0
sweep 100 makers + replenish 3 633 3 414 8 → 0
FOK rejected after walking 100 levels 244 234 0 → 0
PostOnly rejected 7.5 5.7 0 → 0
mixed: 70% rest, 25% fill one, 5% sweep 10 45 33 0.3 → 0

Trades no longer allocate: they go to a TradeSink one by one instead of being appended to a slice in the report. Reserving the order slot before matching costs nothing measurable.

@ilyapt
ilyapt marked this pull request as ready for review October 22, 2026 14:16
@ilyapt
ilyapt merged commit 42fcae3 into main Oct 22, 2026
3 checks passed
@ilyapt
ilyapt deleted the trade-sink branch October 23, 2026 15:24
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