austinjones / postage-rs

The feature-rich, portable async channel library
MIT License
252 stars 9 forks source link

Significantly improve the performance of the broadcast channel by minimizing locks #19

Closed austinjones closed 3 years ago

austinjones commented 3 years ago
austinjones commented 3 years ago

Before:

   Compiling postage v0.3.1 (/Users/austinjones/open-source/postage-rs)
    Finished bench [optimized] target(s) in 6.08s
     Running target/release/deps/broadcast-487dd7aba238ff72
Gnuplot not found, using plotters backend
broadcast::send_recv    time:   [137.99 ns 138.26 ns 138.59 ns]
                        change: [-0.8963% -0.3878% +0.1446%] (p = 0.15 > 0.05)
                        No change in performance detected.
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe

broadcast::send_full    time:   [50.716 ns 51.080 ns 51.480 ns]
                        change: [-1.3998% -0.5890% +0.1696%] (p = 0.14 > 0.05)
                        No change in performance detected.
Found 15 outliers among 100 measurements (15.00%)
  10 (10.00%) high mild
  5 (5.00%) high severe

broadcast::recv_empty   time:   [38.173 ns 38.345 ns 38.542 ns]
                        change: [-2.2734% -1.3031% -0.4116%] (p = 0.01 < 0.05)
                        Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe
austinjones commented 3 years ago

After:

Gnuplot not found, using plotters backend
broadcast::send_recv    time:   [140.21 ns 141.29 ns 142.51 ns]
                        change: [-0.2060% +0.7462% +1.8911%] (p = 0.14 > 0.05)
                        No change in performance detected.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe

broadcast::send_full    time:   [7.2293 ns 7.3371 ns 7.4850 ns]
                        change: [-85.429% -85.166% -84.890%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
  7 (7.00%) high mild
  6 (6.00%) high severe

broadcast::recv_empty   time:   [7.6695 ns 7.6792 ns 7.6903 ns]
                        change: [-80.017% -79.887% -79.742%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  4 (4.00%) high mild
  5 (5.00%) high severe