Repository navigation
docs(streaming): record where the streaming walks' time went (#205) - #367
Merged
Merged
Conversation
The streaming walks were 5 to 18 times slower than the legacy reader and nobody had profiled why. This records the profile (Instruments' Time Profiler on release builds with line tables, samples aggregated by function and by source line through atos), what each finding was and which pull request fixed it, the before and after of the five changes together (R14 and R2000 about 4.2x, R2004 to R2018 about 2.3x, R2007 2.55x), two attempts measured and dropped, and what is left and why: the LZ77 decoder, the checks the legacy reader does not make, the walkers' per-step plumbing and, on R2007, the syndromes and the slice source's per-byte gather. stream_throughput gains --streaming-only, which skips the legacy reader so a sampling profiler sees only the walk.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Records the profile the streaming walks never had. They were 5 to 18 times slower than the legacy reader and "where the walk's time goes ... has not been profiled" was written in this README. The new Throughput section has the method (Instruments' Time Profiler on release builds with line tables,
xctrace export, samples aggregated by function and by source line throughatos -i), each finding with the pull request that fixed it (#360, #362, #364, #365, #366), the before and after of the five together on the same harness, two attempts that were measured and dropped, and what is left and why.Before (
origin/mainata315f04) to after (that tree plus #360, #362, #364, #365, #366), best of 40 (15 for R2007), Apple M2 Max under load:sample_AC1014sample_AC1015sample_AC1018sample_AC1024sample_AC1027sample_AC1032sample_AC1021What is left (profile of the five together, R2010): the LZ77 decoder is 45% of samples, about 0.8 ns per output byte, comparable to the legacy reader's whole read of every section, so it is not the gap; the record CRC (17%) and the page checksum (about 9%) are checks the legacy reader does not make; the walkers' per-step plumbing is about 13%. On R2007 the syndromes (17.8%), the LZ decoder (16.9%) and
SliceSource::poll_gather(13%, a transport cost) lead. Two attempts are recorded as dropped: slice copies in the LZ77 decoder (1 to 2%, within noise: copies are three to fourteen bytes) and a weighted-sum form of the checksum (0.63x of the loop it replaces).examples/stream_throughput.rsgains--streaming-only, which skips the legacy reader so a sampling profiler sees only the walk. No library code changes.This describes the five speedups merged: it should land after #360, #362, #364, #365 and #366.
Spec reference
Documentation and a harness flag only; no format finding and no coverage-state change. Part of #205.
Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurespython3 tools/streaming/check_invariants.py,python3 tools/maintainer/train/arch.py checksample_AC1024.dwgandsample_AC1015.dwg(stream_throughput <file> --runs 3 --streaming-onlyprints one line per file with no legacy columns, and without the flag the output is unchanged). No library or test change, socargo testand the streaming verifiers are not affected by this PR.Source-provenance declaration
By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:
CLEANROOM.md).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.See
CLEANROOM.mdfor the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.
I will sign off commits with
git commit -swhen asked, which adds aSigned-off-bytrailer to the commit message asserting the DCO.