rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.72k stars 309 forks source link

Specialize `Multipeek::fold` #820

Closed Philippe-Cholet closed 10 months ago

Philippe-Cholet commented 10 months ago

Related to #755

cargo bench --bench specializations "multipeek/fold"

multipeek/fold          time:   [1.3502 µs 1.3519 µs 1.3541 µs]
multipeek/fold          time:   [580.87 ns 582.37 ns 584.50 ns]
                        change: [-56.635% -56.096% -55.316%]