Commit 66f75dd
committed
Auto merge of #111379 - nyurik:intersperse-speed-up, r=cuviper
Boost iterator intersperse(_with) performance
I did some benchmark digging into the `intersperse` and `intersperse_with` code as part of [this discussion](https://internals.rust-lang.org/t/add-iterate-with-separators-iterator-function/18781/13), and as a result I optimized them a bit, without relying on the peekable iterator.
See also [full benchmark repo](https://github.com/nyurik/intersperse_perf)
Benchmarks show near 2x performance improvements with the simple `sum` [benchmarks](https://gist.github.com/nyurik/68b6c9b3d90f0d14746d4186bf8fa1e2):
File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments