perf(shred): skip primary FEC reparse — reduce packet-worker overhead#91
Merged
Conversation
02043f4 to
6efd16c
Compare
87842d6 to
aaca6c5
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.
Description
Reduce packet-worker FEC overhead without changing SOF API contracts or feature scope.
This PR removes a redundant primary-packet shred reparse in the FEC ingest path by reusing the already-validated parsed header that packet workers already carry.
Changes
Detailed list of what changed:
crates/sof-observer/src/app/runtime/runloop/packet_workers.rs: pass the existingParsedShredHeaderinto the FEC recoverer instead of forcing the recoverer to parse the primary packet bytes again.crates/sof-observer/src/shred/fec/core.rs: change primary-packet ingest to consumeParsedShredHeaderand use it for slot/FEC-set/variant routing, avoiding a second full parse on the hot path.For slice-related changes, include:
app/runtime/runloop,shred/fec.Motivation
Business motivation:
Technical motivation:
ParsedShredHeaderfor accepted packets.FecRecoverer::ingest_packetwastes CPU on the primary-path hot loop.Alternative approaches considered:
Scope and impact
110 msto94 msover50,000iterations.Testing
Commands/results:
Results: passed.
Related issues and documentation
docs/operations/tx-reconstruction-and-packet-processing-todo-2026-03-24.mddocs/architecture/README.mdReviewer checklist
docs/architecture/ard/0003-slice-dependency-contracts.md)Additional notes
This PR is independent of the completed-dataset perf work and can be reviewed directly on top of
refactor/import-hygiene.