Repository navigation
Specialize TupleWindows fold - #1134
Closed
CollinYuanjieRen wants to merge 1 commit into
Closed
CollinYuanjieRen wants to merge 1 commit into
CollinYuanjieRen wants to merge 1 commit into
Conversation
Member
|
TupleWindows is on the way out. Can you deprecate tuple_windows (we have array_windows instead)? If you want, you can try specializing Array windows::fold. |
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.
Related to #755.
Initialize the first window once, then delegate to the inner iterator's
fold. Keep the width-one no-clone path and stop immediately when initial collection fails. Add regressions for partially consumed and non-fused inputs, clone/consumer panics, and callback/iterator/window drop order against the defaultnextloop.Short Criterion comparison on Rust 1.95.0 / Linux aarch64, 4,096
u64values, 20 samples with 1 s warm-up and measurement (means):The chained case improves about 3.1×; flat slices mostly do not benefit, and width 4 regresses about 11% in this run.
Validation:
cargo test --test specializations tuple_windows,cargo fmt --check, and warning-free Clippy for the alloc-only library and changed test/benchmark targets. Benchmark:cargo bench --bench fold_specialization -- tuple_windows --sample-size 20 --measurement-time 1 --warm-up-time 1.