summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/usefulness.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-27 08:16:49 +0000
committerbors <bors@rust-lang.org>2024-01-27 08:16:49 +0000
commit8b6a431b3d3066a54dffc7f16bf658cf5690efc9 (patch)
tree0d096553663ab4e9c4ea2e7f995161d612007889 /compiler/rustc_pattern_analysis/src/usefulness.rs
parent04521fd10e6eefb113ca1cefd02862599fd08640 (diff)
parent77f31ef2b29e0ff16b9db8907327741c057bea8e (diff)
downloadrust-8b6a431b3d3066a54dffc7f16bf658cf5690efc9.tar.gz
rust-8b6a431b3d3066a54dffc7f16bf658cf5690efc9.zip
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):
![image](https://user-images.githubusercontent.com/1641515/237005195-16aebef4-9eed-4514-8b7c-da1d1f5bd9e0.png)
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/usefulness.rs')
0 files changed, 0 insertions, 0 deletions