Repository navigation
perf(station): publish no chart line copies on a station - #1142
Merged
Merged
Conversation
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.
What & why
The live feed publishes every core's whole order list twice: as the order table (
FeedMsg::Orders, every 250 ms when an order changed) and, for the chart, as line copies (FeedMsg::OrderLines, leading edge then at most every 50 ms). A headless station has no chart, yet it built and applied both. In a station CPU report from a 70-core user (#1081) the order messages were 96–99 % of the main thread, and the line copies were the larger part.On a station a line event now puts the table in debt instead (
OrderDebts::of_turn,feed/live/publish_gate.rs). The turns captured for the copies keep being captured and ride the next table, so an order removed between two tables still reaches the store, as it did through a copy. The terminal is unchanged.Measured on our 27-core station with the Mini App on, A/B in one process (the mode alternated every 5 minutes, two cycles each, first minute after start excluded):
The measured build was based on
5cce1f02, before #1141, which made applying both kinds of message cheaper; the saving on top of #1141 is therefore somewhat smaller on the apply side, and unchanged on the row building.Notable decisions
panic_snapshot_armed) and the clock-skew estimator. Both now see an order change within the table's 250 ms instead of ≤50 ms. A Panic Sell pressed in the Mini App still shows at once through the optimistic override (3 s TTL); one toggled in the core shows up to ~200 ms later. Nothing on the trading side moves: the station only re-reads what the core already sent.Known limitations
Issues
Refs #1081 — CPU of the station's order path; the out-of-memory cause in #1081 is still open.
How to verify
fmt exit 0, build exit 0, clippy zero warnings, 8556 tests green (three new in
publish_gate/tests.rs). Live: a station build carrying this change has run on our station since 10:14 UTC: 27/29 cores ready as before, no panic, no slow main-loop pass.