diff options
| author | Josh Stone <jistone@redhat.com> | 2017-09-14 13:51:32 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2017-09-14 13:51:32 -0700 |
| commit | 61a7703e5575795e837d16d3a0ec46551cc6b69b (patch) | |
| tree | 7a49c5b226aac30516e9babc15c81a6b01fe3e1f /src/test/incremental/thinlto | |
| parent | 5dfc84cfa72b405c194228b53c4de3f6474204ec (diff) | |
| download | rust-61a7703e5575795e837d16d3a0ec46551cc6b69b.tar.gz rust-61a7703e5575795e837d16d3a0ec46551cc6b69b.zip | |
Customize `<FlatMap as Iterator>::fold`
`FlatMap` can use internal iteration for its `fold`, which shows a
performance advantage in the new benchmarks:
test iter::bench_flat_map_chain_ref_sum ... bench: 4,354,111 ns/iter (+/- 108,871)
test iter::bench_flat_map_chain_sum ... bench: 468,167 ns/iter (+/- 2,274)
test iter::bench_flat_map_ref_sum ... bench: 449,616 ns/iter (+/- 6,257)
test iter::bench_flat_map_sum ... bench: 348,010 ns/iter (+/- 1,227)
... where the "ref" benches are using `by_ref()` that isn't optimized.
So this change shows a decent advantage on its own, but much more when
combined with a `chain` iterator that also optimizes `fold`.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
