Commit bdae026
committed
Optimize FromIterator by using fold.
If you're curious why this works, see [1]. The benchmark results on
Rust 1.42.0:
simple iterator time: [5.3103 ns 5.3130 ns 5.3161 ns]
change: [+0.7242% +1.1547% +1.5162%] (p = 0.00 < 0.05)
Change within noise threshold.
Found 12 outliers among 100 measurements (12.00%)
7 (7.00%) high mild
5 (5.00%) high severe
chained iterator time: [15.553 ns 15.566 ns 15.576 ns]
change: [-15.667% -15.456% -15.270%] (p = 0.00 < 0.05)
Performance has improved.
[1]: https://medium.com/@veedrac/rust-is-slow-and-i-am-the-cure-32facc0fdcb1 parent b5bfd08 commit bdae026
1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 381 | + | |
386 | 382 | | |
387 | 383 | | |
388 | 384 | | |
| |||
0 commit comments