about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-09-16 09:16:55 -0500
committerAlex Crichton <alex@alexcrichton.com>2017-09-16 17:09:40 -0700
commit3dbd9c5489702442831d5600c6aacd27159984d4 (patch)
tree55bd59ed9fc35597d1f1b5ab99adc7d30bf6d600 /src/test/incremental/thinlto
parentc25290d7150ef5be75edf00420f25cbad2280f0f (diff)
parent351f56a6034486c38c3b36bfbbd15a81a39ba9aa (diff)
downloadrust-3dbd9c5489702442831d5600c6aacd27159984d4.tar.gz
rust-3dbd9c5489702442831d5600c6aacd27159984d4.zip
Rollup merge of #44577 - cuviper:flat_map-fold, r=alexcrichton
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