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

Optimize thread_worker #13056

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Commits on Aug 30, 2023

  1. Optimize thread_worker

    Use a ring buffer to bulk pass tasks around, and also support creating a
    twin worker thread for every reactor thread.
    
    Before:
    
    ```
    test                                      iterations      median         mad         min         max      allocs       tasks        inst
    thread_worker_test.1                            3354   216.749us    47.062ns   216.590us   216.951us       5.000       4.000   1610844.2
    thread_worker_test.10                            460     2.088ms   870.335ns     2.087ms     2.089ms      70.000      58.000  25391981.4
    thread_worker_test.100                            61    16.465ms     1.733us    16.461ms    16.469ms     700.000     598.000 208106393.1
    thread_worker_test.1000                           50    19.925ms     6.187us    19.919ms    19.937ms    7007.000    5998.000 214776807.2
    ```
    
    After:
    
    ```
    test                                      iterations      median         mad         min         max      allocs       tasks        inst
    thread_worker_test.1                            1855   216.515us    77.552ns   216.330us   216.593us       4.000       4.000   1549639.0
    thread_worker_test.10                            413     2.085ms   394.971ns     2.084ms     2.086ms      40.000      40.000  24921287.6
    thread_worker_test.100                           113     8.518ms     3.891us     8.513ms     8.524ms     400.000     400.000 106121583.5
    thread_worker_test.1000                           93    10.424ms   605.968ns    10.423ms    10.426ms    4880.000    5744.000 127114775.7
    ```
    
    Signed-off-by: Tyler Rockwood <[email protected]>
    rockwotj committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    1edf4c8 View commit details
    Browse the repository at this point in the history