Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize <FlatMap as Iterator>::fold #44577

Merged
merged 2 commits into from
Sep 17, 2017
Merged

Commits on Sep 14, 2017

  1. 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`.
    cuviper committed Sep 14, 2017
    Configuration menu
    Copy the full SHA
    61a7703 View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2017

  1. Configuration menu
    Copy the full SHA
    351f56a View commit details
    Browse the repository at this point in the history