• Jason Madden's avatar
    Optimizations for threadpool · 50a3130b
    Jason Madden authored
    Especially for map. None of the pools really need map to go through
    imap since they have to wait for everything anyway and they return
    results ordererd.
    
    | Benchmark          | 36_threadpool_master | 36_threadpool_opt_cond5     |
    |--------------------|----------------------|-----------------------------|
    | imap_unordered_seq | 1.15 ms              | 1.07 ms: 1.08x faster (-7%) |
    | imap_unordered_par | 1.02 ms              | 950 us: 1.08x faster (-7%)  |
    | imap_seq           | 1.17 ms              | 1.10 ms: 1.06x faster (-6%) |
    | imap_par           | 1.07 ms              | 1000 us: 1.07x faster (-7%) |
    | map_seq            | 1.16 ms              | 724 us: 1.60x faster (-37%) |
    | map_par            | 1.07 ms              | 646 us: 1.66x faster (-40%) |
    | apply              | 1.22 ms              | 1.14 ms: 1.07x faster (-7%) |
    | spawn              | 1.21 ms              | 1.13 ms: 1.07x faster (-7%) |
    50a3130b
bench_threadpool.py 2.49 KB