Repository navigation
perf(transport): eliminate heap allocations and HashMap churn in FecReassembler hot path - #176
Merged
Merged
Conversation
…c bitset and object table
vxfemboy
temporarily deployed
to
benchmark-approval
October 26, 2026 23:58 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 26, 2026 23:58 — with
GitHub Actions
Inactive
…refactor and docs overhaul
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 00:08 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 00:08 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Resolves #171
Summary
This PR eliminates heap allocations, per-shard
HashMaplookups, and intermediate vector cloning inFecReassembler::push(), delivering zero-alloc in-place reassembly for clean-path transport and eliminatingVec<Vec<u8>>allocation during Reed-Solomon packet-loss recovery. It also updates the documentation curriculum, architectural specifications, roadmap, and changelog.Changes
ObjState& Systematic Slicing:shards: HashMap<u16, Vec<u8>>inObjStatewith a 256-bit bitset (seen_mask: [u64; 4]) and pre-allocated contiguouspayload: Vec<u8>.idx < K) are copied directly intopayload[idx * shard_len ..]with zero heap allocation.source_count == K) returns the completed object viastd::mem::take(&mut state.payload)andtruncate(size), completely skipping RS decoding and vector stitching.reconstruct_missing_sources):decode_source_intoandreconstruct_missing_sourcesincrates/yip-transport/src/rs.rs.Vec<Vec<u8>>heap matrix churn.ObjectTable:HashMap<u64, ObjState>withObjectTable, a flat contiguous table using SplitMix64 fast hashing and backward-shift deletion with zero tombstones and zero dynamic heap reallocations during packet ingress/eviction.order: VecDeque<u64>ring buffer capacity.benches/fec_reassemble.rstoyip-bench.CHANGELOG.mdunder## [Unreleased]with dedicated### Performance,### Added, and### Changedsections.ROADMAP.mdmoving the zero-allocation hot path (perf(transport): eliminate heap allocations and HashMap churn in FecReassembler hot path #171) and comprehensive docs overhaul (docs: comprehensive README and documentation overhaul for onboarding and clarity #170) to## Done.README.md,docs/03-architecture.md, anddocs/05-benchmarking-and-performance.mdwith zero-allocation architecture details and Criterion microbenchmark results.Benchmark Results (Criterion)
fec_reassemble_clean_k1fec_reassemble_clean_k3fec_reassemble_loss_k3_r1Verification
cargo test --workspace: All 387 workspace unit tests + 98 integration tests pass cleanly.cargo clippy --workspace --all-targets -- -D warnings: Clean.cargo fmt --check: Clean.cargo shear: Clean.