-
Notifications
You must be signed in to change notification settings - Fork 115
feat: support listeners & tunnel #732
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can we tell if ArcSwap is better than rwlock? is there any measurement?
if it's way better than rwlock, why not replace all the rwlock at once in a separate PR then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArcSwap is faster, becasue its lockless(just like std Atomic). However it not a replacement of Rwlock. It depends on use case. Only stateless data structure can use ArcSwap, like String, number, or struct made up of these types, or structs those dont have interior mutability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mean it's better to have some measurement (or the official benchmark result) along with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results
Running benches\background.rs (target\release\deps\background-102f3dcff8fe29ea.exe)
Gnuplot not found, using plotters backend
arc_swap_b_read/r1 time: [40.555 ns 40.615 ns 40.688 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
arc_swap_b_read/r3 time: [83.380 ns 84.144 ns 84.936 ns]
Found 14 outliers among 100 measurements (14.00%)
14 (14.00%) high mild
arc_swap_b_read/l1 time: [37.921 ns 37.987 ns 38.054 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low mild
arc_swap_b_read/l3 time: [101.76 ns 102.92 ns 104.04 ns]
arc_swap_b_read/rw time: [48.964 ns 49.516 ns 50.106 ns]
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) low severe
1 (1.00%) low mild
6 (6.00%) high severe
arc_swap_b_read/lw time: [42.400 ns 44.501 ns 46.177 ns]
arc_swap_b_read/w2 time: [24.000 ns 24.345 ns 24.707 ns]
Found 22 outliers among 100 measurements (22.00%)
8 (8.00%) low mild
11 (11.00%) high mild
3 (3.00%) high severe
arc_swap_b_read/uncontended
time: [5.9771 ns 5.9827 ns 5.9890 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
arc_swap_b_write/r1 time: [241.98 ns 242.83 ns 243.59 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
arc_swap_b_write/r3 time: [364.94 ns 365.52 ns 366.11 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
arc_swap_b_write/l1 time: [229.97 ns 230.75 ns 231.75 ns]
arc_swap_b_write/l3 time: [412.31 ns 416.93 ns 421.61 ns]
arc_swap_b_write/rw time: [519.15 ns 519.51 ns 519.92 ns]
Found 19 outliers among 100 measurements (19.00%)
18 (18.00%) high mild
1 (1.00%) high severe
arc_swap_b_write/lw time: [500.70 ns 501.05 ns 501.40 ns]
arc_swap_b_write/w2 time: [726.34 ns 728.98 ns 730.62 ns]
Found 17 outliers among 100 measurements (17.00%)
1 (1.00%) low severe
1 (1.00%) low mild
15 (15.00%) high severe
arc_swap_b_write/uncontended
time: [94.140 ns 94.174 ns 94.212 ns]
Found 14 outliers among 100 measurements (14.00%)
3 (3.00%) low severe
1 (1.00%) low mild
4 (4.00%) high mild
6 (6.00%) high severe
arc_swap_b_lease/r1 time: [3.0178 ns 3.0210 ns 3.0274 ns]
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) low mild
2 (2.00%) high mild
3 (3.00%) high severe
arc_swap_b_lease/r3 time: [3.0110 ns 3.0153 ns 3.0208 ns]
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
arc_swap_b_lease/l1 time: [3.0289 ns 3.0297 ns 3.0307 ns]
Found 5 outliers among 100 measurements (5.00%)
4 (4.00%) high mild
1 (1.00%) high severe
arc_swap_b_lease/l3 time: [3.0798 ns 3.0905 ns 3.1066 ns]
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe
arc_swap_b_lease/rw time: [9.5948 ns 9.8004 ns 10.004 ns]
Found 16 outliers among 100 measurements (16.00%)
2 (2.00%) low mild
1 (1.00%) high mild
13 (13.00%) high severe
arc_swap_b_lease/lw time: [11.766 ns 11.796 ns 11.819 ns]
Found 19 outliers among 100 measurements (19.00%)
19 (19.00%) low severe
arc_swap_b_lease/w2 time: [12.703 ns 12.854 ns 13.034 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
arc_swap_b_lease/uncontended
time: [3.0328 ns 3.0338 ns 3.0350 ns]
Found 8 outliers among 100 measurements (8.00%)
3 (3.00%) low mild
5 (5.00%) high mild
arc_swap_b_four_leases/r1
time: [39.939 ns 40.193 ns 40.445 ns]
Found 12 outliers among 100 measurements (12.00%)
6 (6.00%) low severe
5 (5.00%) low mild
1 (1.00%) high mild
arc_swap_b_four_leases/r3
time: [66.254 ns 66.709 ns 67.202 ns]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
arc_swap_b_four_leases/l1
time: [14.154 ns 14.215 ns 14.310 ns]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) high mild
3 (3.00%) high severe
arc_swap_b_four_leases/l3
time: [14.685 ns 14.978 ns 15.355 ns]
Found 20 outliers among 100 measurements (20.00%)
1 (1.00%) high mild
19 (19.00%) high severe
arc_swap_b_four_leases/rw
time: [56.401 ns 57.080 ns 57.839 ns]
arc_swap_b_four_leases/lw
time: [46.524 ns 47.349 ns 48.073 ns]
arc_swap_b_four_leases/w2
time: [53.886 ns 54.993 ns 56.124 ns]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
arc_swap_b_four_leases/uncontended
time: [13.997 ns 14.004 ns 14.014 ns]
Found 9 outliers among 100 measurements (9.00%)
1 (1.00%) low mild
5 (5.00%) high mild
3 (3.00%) high severe
arc_swap_option_read/r1 time: [4.0479 ns 4.0843 ns 4.1575 ns]
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) high mild
5 (5.00%) high severe
arc_swap_option_read/r3 time: [4.1099 ns 4.1319 ns 4.1657 ns]
Found 19 outliers among 100 measurements (19.00%)
2 (2.00%) low severe
2 (2.00%) low mild
5 (5.00%) high mild
10 (10.00%) high severe
arc_swap_option_read/l1 time: [4.0439 ns 4.0456 ns 4.0475 ns]
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
arc_swap_option_read/l3 time: [4.1129 ns 4.1397 ns 4.1934 ns]
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe
arc_swap_option_read/rw time: [48.360 ns 48.671 ns 48.930 ns]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low severe
1 (1.00%) high severe
arc_swap_option_read/lw time: [31.254 ns 32.078 ns 33.135 ns]
Found 14 outliers among 100 measurements (14.00%)
3 (3.00%) low severe
4 (4.00%) low mild
2 (2.00%) high mild
5 (5.00%) high severe
arc_swap_option_read/w2 time: [24.041 ns 24.131 ns 24.226 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
arc_swap_option_read/uncontended
time: [5.9797 ns 5.9829 ns 5.9871 ns]
Found 7 outliers among 100 measurements (7.00%)
5 (5.00%) high mild
2 (2.00%) high severe
arc_swap_option_write/r1
time: [229.67 ns 230.16 ns 230.69 ns]
Found 16 outliers among 100 measurements (16.00%)
13 (13.00%) low mild
3 (3.00%) high severe
arc_swap_option_write/r3
time: [382.20 ns 384.37 ns 386.59 ns]
arc_swap_option_write/l1
time: [249.69 ns 249.78 ns 249.88 ns]
Found 9 outliers among 100 measurements (9.00%)
7 (7.00%) high mild
2 (2.00%) high severe
arc_swap_option_write/l3
time: [420.79 ns 422.55 ns 424.36 ns]
arc_swap_option_write/rw
time: [510.27 ns 511.44 ns 512.77 ns]
arc_swap_option_write/lw
time: [538.37 ns 540.57 ns 543.21 ns]
arc_swap_option_write/w2
time: [764.32 ns 768.63 ns 771.39 ns]
Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) low severe
1 (1.00%) low mild
2 (2.00%) high mild
1 (1.00%) high severe
arc_swap_option_write/uncontended
time: [94.863 ns 94.986 ns 95.126 ns]
Found 12 outliers among 100 measurements (12.00%)
1 (1.00%) low mild
3 (3.00%) high mild
8 (8.00%) high severe
arc_swap_option_lease/r1
time: [9.6821 ns 9.7124 ns 9.7445 ns]
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) low severe
3 (3.00%) low mild
1 (1.00%) high mild
arc_swap_option_lease/r3
time: [19.692 ns 19.723 ns 19.756 ns]
Found 11 outliers among 100 measurements (11.00%)
4 (4.00%) low mild
3 (3.00%) high mild
4 (4.00%) high severe
arc_swap_option_lease/l1
time: [3.2881 ns 3.2912 ns 3.2951 ns]
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
arc_swap_option_lease/l3
time: [3.3345 ns 3.3512 ns 3.3845 ns]
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
arc_swap_option_lease/rw
time: [13.196 ns 13.208 ns 13.220 ns]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low severe
1 (1.00%) low mild
2 (2.00%) high mild
arc_swap_option_lease/lw
time: [9.9961 ns 10.012 ns 10.027 ns]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
2 (2.00%) high mild
1 (1.00%) high severe
arc_swap_option_lease/w2
time: [13.651 ns 13.663 ns 13.677 ns]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) low mild
3 (3.00%) high mild
3 (3.00%) high severe
arc_swap_option_lease/uncontended
time: [3.2637 ns 3.2650 ns 3.2667 ns]
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
arc_swap_cached_read/r1 time: [62.804 ns 62.909 ns 63.014 ns]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high mild
arc_swap_cached_read/r3 time: [151.88 ns 153.49 ns 154.98 ns]
Found 9 outliers among 100 measurements (9.00%)
6 (6.00%) low severe
2 (2.00%) low mild
1 (1.00%) high mild
arc_swap_cached_read/l1 time: [60.853 ns 61.024 ns 61.228 ns]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
arc_swap_cached_read/l3 time: [186.26 ns 190.28 ns 193.64 ns]
arc_swap_cached_read/rw time: [81.360 ns 81.418 ns 81.479 ns]
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe
arc_swap_cached_read/lw time: [74.640 ns 74.670 ns 74.704 ns]
Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) low mild
3 (3.00%) high mild
1 (1.00%) high severe
arc_swap_cached_read/w2 time: [32.198 ns 32.325 ns 32.475 ns]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low mild
1 (1.00%) high mild
arc_swap_cached_read/uncontended
time: [8.8444 ns 8.8477 ns 8.8517 ns]
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe
arc_swap_cached_write/r1
time: [227.71 ns 227.82 ns 227.94 ns]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low mild
1 (1.00%) high severe
arc_swap_cached_write/r3
time: [359.28 ns 360.81 ns 362.58 ns]
Found 18 outliers among 100 measurements (18.00%)
10 (10.00%) low severe
3 (3.00%) low mild
1 (1.00%) high mild
4 (4.00%) high severe
arc_swap_cached_write/l1
time: [229.64 ns 229.82 ns 230.00 ns]
Found 8 outliers among 100 measurements (8.00%)
4 (4.00%) low severe
2 (2.00%) low mild
2 (2.00%) high mild
arc_swap_cached_write/l3
time: [418.19 ns 421.93 ns 425.73 ns]
arc_swap_cached_write/rw
time: [534.71 ns 541.95 ns 546.48 ns]
Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) low severe
3 (3.00%) low mild
arc_swap_cached_write/lw
time: [517.20 ns 525.21 ns 531.97 ns]
Found 16 outliers among 100 measurements (16.00%)
5 (5.00%) low severe
10 (10.00%) low mild
1 (1.00%) high mild
arc_swap_cached_write/w2
time: [616.71 ns 654.93 ns 690.19 ns]
Found 11 outliers among 100 measurements (11.00%)
11 (11.00%) low mild
arc_swap_cached_write/uncontended
time: [94.560 ns 94.593 ns 94.629 ns]
Found 10 outliers among 100 measurements (10.00%)
2 (2.00%) low mild
4 (4.00%) high mild
4 (4.00%) high severe
mutex_read/r1 time: [77.217 ns 77.410 ns 77.612 ns]
Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) low mild
3 (3.00%) high mild
mutex_read/r3 time: [395.78 ns 402.31 ns 409.04 ns]
mutex_read/l1 time: [39.371 ns 39.613 ns 39.889 ns]
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe
mutex_read/l3 time: [182.39 ns 183.90 ns 185.53 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
mutex_read/rw time: [217.30 ns 219.87 ns 222.66 ns]
mutex_read/lw time: [213.08 ns 214.79 ns 216.36 ns]
mutex_read/w2 time: [234.14 ns 236.70 ns 238.91 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) low severe
mutex_read/uncontended time: [5.9585 ns 5.9863 ns 6.0213 ns]
mutex_write/r1 time: [206.50 ns 208.01 ns 209.59 ns]
Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) low severe
3 (3.00%) low mild
4 (4.00%) high mild
mutex_write/r3 time: [626.84 ns 641.53 ns 656.87 ns]
mutex_write/l1 time: [142.09 ns 142.19 ns 142.30 ns]
Found 9 outliers among 100 measurements (9.00%)
4 (4.00%) low mild
5 (5.00%) high mild
mutex_write/l3 time: [483.94 ns 489.41 ns 494.78 ns]
mutex_write/rw time: [426.50 ns 429.26 ns 432.22 ns]
Found 15 outliers among 100 measurements (15.00%)
8 (8.00%) low mild
1 (1.00%) high mild
6 (6.00%) high severe
mutex_write/lw time: [353.29 ns 356.52 ns 359.82 ns]
mutex_write/w2 time: [411.19 ns 431.78 ns 450.89 ns]
Found 6 outliers among 100 measurements (6.00%)
6 (6.00%) low mild
mutex_write/uncontended time: [26.669 ns 26.700 ns 26.733 ns]
Found 13 outliers among 100 measurements (13.00%)
5 (5.00%) high mild
8 (8.00%) high severe
parking_mutex_read/r1 time: [32.599 ns 33.122 ns 33.666 ns]
Found 7 outliers among 100 measurements (7.00%)
6 (6.00%) low mild
1 (1.00%) high mild
parking_mutex_read/r3 time: [311.42 ns 315.48 ns 319.05 ns]
Found 25 outliers among 100 measurements (25.00%)
5 (5.00%) low severe
7 (7.00%) low mild
5 (5.00%) high mild
8 (8.00%) high severe
parking_mutex_read/l1 time: [18.271 ns 18.338 ns 18.397 ns]
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) low mild
2 (2.00%) high mild
1 (1.00%) high severe
parking_mutex_read/l3 time: [118.46 ns 120.43 ns 122.30 ns]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
2 (2.00%) high mild
1 (1.00%) high severe
parking_mutex_read/rw time: [95.280 ns 96.393 ns 97.485 ns]
parking_mutex_read/lw time: [75.870 ns 77.076 ns 78.221 ns]
Found 14 outliers among 100 measurements (14.00%)
8 (8.00%) low severe
6 (6.00%) low mild
parking_mutex_read/w2 time: [81.176 ns 81.849 ns 82.515 ns]
parking_mutex_read/uncontended
time: [6.2626 ns 6.2675 ns 6.2727 ns]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high severe
parking_mutex_write/r1 time: [183.18 ns 183.91 ns 184.79 ns]
Found 13 outliers among 100 measurements (13.00%)
11 (11.00%) high mild
2 (2.00%) high severe
parking_mutex_write/r3 time: [530.43 ns 534.81 ns 540.07 ns]
Found 18 outliers among 100 measurements (18.00%)
2 (2.00%) low severe
2 (2.00%) low mild
8 (8.00%) high mild
6 (6.00%) high severe
parking_mutex_write/l1 time: [111.35 ns 111.92 ns 112.50 ns]
Found 13 outliers among 100 measurements (13.00%)
5 (5.00%) low mild
5 (5.00%) high mild
3 (3.00%) high severe
parking_mutex_write/l3 time: [415.73 ns 423.76 ns 430.16 ns]
Found 8 outliers among 100 measurements (8.00%)
5 (5.00%) low severe
1 (1.00%) low mild
2 (2.00%) high mild
parking_mutex_write/rw time: [371.41 ns 374.59 ns 378.21 ns]
Found 17 outliers among 100 measurements (17.00%)
5 (5.00%) low severe
4 (4.00%) low mild
5 (5.00%) high mild
3 (3.00%) high severe
parking_mutex_write/lw time: [314.08 ns 316.67 ns 319.17 ns]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) low mild
parking_mutex_write/w2 time: [320.25 ns 322.81 ns 325.05 ns]
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low mild
2 (2.00%) high mild
1 (1.00%) high severe
parking_mutex_write/uncontended
time: [26.576 ns 26.585 ns 26.595 ns]
Found 10 outliers among 100 measurements (10.00%)
1 (1.00%) low mild
7 (7.00%) high mild
2 (2.00%) high severe
rwlock_read/r1 time: [52.851 ns 52.969 ns 53.084 ns]
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low severe
2 (2.00%) low mild
rwlock_read/r3 time: [85.565 ns 86.534 ns 88.119 ns]
Found 10 outliers among 100 measurements (10.00%)
1 (1.00%) low mild
5 (5.00%) high mild
4 (4.00%) high severe
rwlock_read/l1 time: [53.080 ns 53.126 ns 53.170 ns]
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
rwlock_read/l3 time: [109.31 ns 110.29 ns 111.51 ns]
Found 9 outliers among 100 measurements (9.00%)
6 (6.00%) high mild
3 (3.00%) high severe
rwlock_read/rw time: [91.655 ns 92.915 ns 94.347 ns]
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
rwlock_read/lw time: [76.388 ns 78.416 ns 80.616 ns]
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) high mild
2 (2.00%) high severe
rwlock_read/w2 time: [168.34 ns 178.75 ns 189.45 ns]
rwlock_read/uncontended time: [5.9197 ns 5.9233 ns 5.9274 ns]
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) high mild
8 (8.00%) high severe
rwlock_write/r1 time: [219.27 ns 224.13 ns 229.25 ns]
rwlock_write/r3 time: [1.3608 µs 1.3888 µs 1.4162 µs]
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) low severe
2 (2.00%) low mild
rwlock_write/l1 time: [137.69 ns 138.61 ns 139.65 ns]
Found 12 outliers among 100 measurements (12.00%)
4 (4.00%) low mild
1 (1.00%) high mild
7 (7.00%) high severe
rwlock_write/l3 time: [1.2301 µs 1.2708 µs 1.3116 µs]
Found 11 outliers among 100 measurements (11.00%)
2 (2.00%) low severe
9 (9.00%) low mild
rwlock_write/rw time: [348.43 ns 358.33 ns 367.91 ns]
rwlock_write/lw time: [298.06 ns 300.39 ns 303.00 ns]
Found 10 outliers among 100 measurements (10.00%)
9 (9.00%) high mild
1 (1.00%) high severe
rwlock_write/w2 time: [481.91 ns 484.45 ns 487.17 ns]
rwlock_write/uncontended
time: [26.406 ns 26.428 ns 26.456 ns]
parking_rwlock_read/r1 time: [74.782 ns 75.078 ns 75.410 ns]
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) low mild
1 (1.00%) high mild
parking_rwlock_read/r3 time: [174.67 ns 175.07 ns 175.47 ns]
Found 14 outliers among 100 measurements (14.00%)
4 (4.00%) low severe
3 (3.00%) low mild
3 (3.00%) high mild
4 (4.00%) high severe
parking_rwlock_read/l1 time: [58.243 ns 58.595 ns 58.964 ns]
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) low mild
3 (3.00%) high mild
1 (1.00%) high severe
parking_rwlock_read/l3 time: [141.81 ns 142.94 ns 144.52 ns]
Found 16 outliers among 100 measurements (16.00%)
4 (4.00%) low severe
7 (7.00%) low mild
2 (2.00%) high mild
3 (3.00%) high severe
parking_rwlock_read/rw time: [299.22 ns 302.37 ns 304.82 ns]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) low severe
3 (3.00%) low mild
3 (3.00%) high mild
parking_rwlock_read/lw time: [262.52 ns 265.88 ns 268.88 ns]
Found 7 outliers among 100 measurements (7.00%)
3 (3.00%) low severe
3 (3.00%) low mild
1 (1.00%) high mild
parking_rwlock_read/w2 time: [339.38 ns 341.36 ns 343.30 ns]
Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) low severe
2 (2.00%) low mild
1 (1.00%) high severe
parking_rwlock_read/uncontended
time: [5.9217 ns 5.9227 ns 5.9238 ns]
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) low mild
2 (2.00%) high mild
parking_rwlock_write/r1 time: [66.893 ns 67.042 ns 67.208 ns]
Found 5 outliers among 100 measurements (5.00%)
3 (3.00%) low mild
2 (2.00%) high severe
parking_rwlock_write/r3 time: [181.98 ns 183.86 ns 185.98 ns]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) low mild
parking_rwlock_write/l1 time: [57.895 ns 58.064 ns 58.295 ns]
Found 14 outliers among 100 measurements (14.00%)
2 (2.00%) low mild
2 (2.00%) high mild
10 (10.00%) high severe
parking_rwlock_write/l3 time: [156.88 ns 157.96 ns 159.04 ns]
Found 17 outliers among 100 measurements (17.00%)
9 (9.00%) high mild
8 (8.00%) high severe
parking_rwlock_write/rw time: [259.53 ns 261.95 ns 264.50 ns]
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
parking_rwlock_write/lw time: [218.83 ns 220.16 ns 221.53 ns]
Found 13 outliers among 100 measurements (13.00%)
8 (8.00%) low severe
2 (2.00%) low mild
1 (1.00%) high mild
2 (2.00%) high severe
parking_rwlock_write/w2 time: [323.27 ns 324.23 ns 325.20 ns]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) low mild
4 (4.00%) high mild
2 (2.00%) high severe
parking_rwlock_write/uncontended
time: [26.517 ns 26.551 ns 26.583 ns]
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild
Running benches\int-access.rs (target\release\deps\int_access-5bbc7cd90e89ad49.exe)
mutex (1 + 0) x 100000: 000.004s
mutex (2 + 0) x 100000: 000.047s
mutex (4 + 0) x 100000: 000.185s
mutex (8 + 0) x 100000: 000.462s
mutex (1 + 1) x 100000: 000.043s
mutex (4 + 1) x 100000: 000.306s
mutex (4 + 2) x 100000: 000.427s
mutex (4 + 4) x 100000: 000.533s
mutex (8 + 1) x 100000: 000.487s
mutex (8 + 2) x 100000: 000.520s
mutex (8 + 4) x 100000: 000.447s
mutex (0 + 1) x 100000: 000.003s
mutex (0 + 4) x 100000: 000.194s
mutex-arc (1 + 0) x 100000: 000.003s
mutex-arc (2 + 0) x 100000: 000.029s
mutex-arc (4 + 0) x 100000: 000.165s
mutex-arc (8 + 0) x 100000: 000.532s
mutex-arc (1 + 1) x 100000: 000.066s
mutex-arc (4 + 1) x 100000: 000.427s
mutex-arc (4 + 2) x 100000: 000.619s
mutex-arc (4 + 4) x 100000: 000.817s
mutex-arc (8 + 1) x 100000: 000.584s
mutex-arc (8 + 2) x 100000: 000.657s
mutex-arc (8 + 4) x 100000: 000.756s
mutex-arc (0 + 1) x 100000: 000.026s
mutex-arc (0 + 4) x 100000: 000.699s
mutex-arc-clone (1 + 0) x 100000: 000.007s
mutex-arc-clone (2 + 0) x 100000: 000.082s
mutex-arc-clone (4 + 0) x 100000: 000.418s
mutex-arc-clone (8 + 0) x 100000: 000.802s
mutex-arc-clone (1 + 1) x 100000: 000.080s
mutex-arc-clone (4 + 1) x 100000: 000.572s
mutex-arc-clone (4 + 2) x 100000: 000.687s
mutex-arc-clone (4 + 4) x 100000: 000.1135s
mutex-arc-clone (8 + 1) x 100000: 000.817s
mutex-arc-clone (8 + 2) x 100000: 000.863s
mutex-arc-clone (8 + 4) x 100000: 000.948s
mutex-arc-clone (0 + 1) x 100000: 000.026s
mutex-arc-clone (0 + 4) x 100000: 000.202s
rw (1 + 0) x 100000: 000.004s
rw (2 + 0) x 100000: 000.032s
rw (4 + 0) x 100000: 000.070s
rw (8 + 0) x 100000: 000.273s
rw (1 + 1) x 100000: 000.035s
rw (4 + 1) x 100000: 000.160s
rw (4 + 2) x 100000: 000.310s
rw (4 + 4) x 100000: 000.593s
rw (8 + 1) x 100000: 000.445s
rw (8 + 2) x 100000: 000.502s
rw (8 + 4) x 100000: 000.535s
rw (0 + 1) x 100000: 000.003s
rw (0 + 4) x 100000: 000.207s
rw-arc (1 + 0) x 100000: 000.004s
rw-arc (2 + 0) x 100000: 000.030s
rw-arc (4 + 0) x 100000: 000.069s
rw-arc (8 + 0) x 100000: 000.265s
rw-arc (1 + 1) x 100000: 000.081s
rw-arc (4 + 1) x 100000: 000.172s
rw-arc (4 + 2) x 100000: 000.519s
rw-arc (4 + 4) x 100000: 000.1575s
rw-arc (8 + 1) x 100000: 000.563s
rw-arc (8 + 2) x 100000: 000.876s
rw-arc (8 + 4) x 100000: 000.1492s
rw-arc (0 + 1) x 100000: 000.027s
rw-arc (0 + 4) x 100000: 000.679s
rw-arc-clone (1 + 0) x 100000: 000.006s
rw-arc-clone (2 + 0) x 100000: 000.059s
rw-arc-clone (4 + 0) x 100000: 000.205s
rw-arc-clone (8 + 0) x 100000: 000.653s
rw-arc-clone (1 + 1) x 100000: 000.078s
rw-arc-clone (4 + 1) x 100000: 000.413s
rw-arc-clone (4 + 2) x 100000: 000.785s
rw-arc-clone (4 + 4) x 100000: 000.1772s
rw-arc-clone (8 + 1) x 100000: 000.1075s
rw-arc-clone (8 + 2) x 100000: 000.1205s
rw-arc-clone (8 + 4) x 100000: 000.1726s
rw-arc-clone (0 + 1) x 100000: 000.027s
rw-arc-clone (0 + 4) x 100000: 000.679s
arc-load-store (1 + 0) x 100000: 000.003s
arc-load-store (2 + 0) x 100000: 000.005s
arc-load-store (4 + 0) x 100000: 000.004s
arc-load-store (8 + 0) x 100000: 000.007s
arc-load-store (1 + 1) x 100000: 000.165s
arc-load-store (4 + 1) x 100000: 000.167s
arc-load-store (4 + 2) x 100000: 000.344s
arc-load-store (4 + 4) x 100000: 000.1562s
arc-load-store (8 + 1) x 100000: 000.187s
arc-load-store (8 + 2) x 100000: 000.364s
arc-load-store (8 + 4) x 100000: 000.1542s
arc-load-store (0 + 1) x 100000: 000.226s
arc-load-store (0 + 4) x 100000: 000.1512s
arc-rcu (1 + 0) x 100000: 000.006s
arc-rcu (2 + 0) x 100000: 000.033s
arc-rcu (4 + 0) x 100000: 000.082s
arc-rcu (8 + 0) x 100000: 000.273s
arc-rcu (1 + 1) x 100000: 000.250s
arc-rcu (4 + 1) x 100000: 000.312s
arc-rcu (4 + 2) x 100000: 000.542s
arc-rcu (4 + 4) x 100000: 000.1535s
arc-rcu (8 + 1) x 100000: 000.496s
arc-rcu (8 + 2) x 100000: 000.728s
arc-rcu (8 + 4) x 100000: 000.1434s
arc-rcu (0 + 1) x 100000: 000.247s
arc-rcu (0 + 4) x 100000: 000.1761s
Running benches\track.rs (target\release\deps\track-25fedbcd0fef459d.exe)
Gnuplot not found, using plotters backend
uncontended/load time: [3.1771 ns 3.1860 ns 3.1978 ns]
Found 16 outliers among 100 measurements (16.00%)
1 (1.00%) low severe
7 (7.00%) high mild
8 (8.00%) high severe
uncontended/load_full time: [6.1068 ns 6.1100 ns 6.1128 ns]
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low severe
1 (1.00%) low mild
uncontended/load_many time: [9.4733 ns 9.7131 ns 9.9809 ns]
uncontended/store time: [44.631 ns 44.695 ns 44.764 ns]
Found 13 outliers among 100 measurements (13.00%)
2 (2.00%) low mild
4 (4.00%) high mild
7 (7.00%) high severe
uncontended/cache time: [293.91 ps 295.02 ps 296.94 ps]
Found 7 outliers among 100 measurements (7.00%)
1 (1.00%) low mild
1 (1.00%) high mild
5 (5.00%) high severe
concurrent_loads/load time: [3.2975 ns 3.3344 ns 3.3775 ns]
Found 9 outliers among 100 measurements (9.00%)
1 (1.00%) high mild
8 (8.00%) high severe
concurrent_loads/load_full
time: [6.3057 ns 6.3150 ns 6.3260 ns]
Found 13 outliers among 100 measurements (13.00%)
1 (1.00%) low severe
2 (2.00%) low mild
3 (3.00%) high mild
7 (7.00%) high severe
concurrent_loads/load_many
time: [9.2191 ns 9.2435 ns 9.2914 ns]
Found 8 outliers among 100 measurements (8.00%)
2 (2.00%) high mild
6 (6.00%) high severe
concurrent_loads/store time: [321.13 ns 323.59 ns 326.17 ns]
Found 11 outliers among 100 measurements (11.00%)
9 (9.00%) low mild
2 (2.00%) high mild
concurrent_loads/cache time: [306.08 ps 311.33 ps 317.21 ps]
Found 20 outliers among 100 measurements (20.00%)
2 (2.00%) high mild
18 (18.00%) high severe
concurrent_store/load time: [21.832 ns 22.034 ns 22.181 ns]
Found 12 outliers among 100 measurements (12.00%)
7 (7.00%) low severe
3 (3.00%) low mild
2 (2.00%) high mild
concurrent_store/load_full
time: [31.717 ns 32.093 ns 32.341 ns]
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low severe
2 (2.00%) low mild
concurrent_store/load_many
time: [41.866 ns 42.146 ns 42.362 ns]
Found 8 outliers among 100 measurements (8.00%)
4 (4.00%) low severe
1 (1.00%) low mild
1 (1.00%) high mild
2 (2.00%) high severe
concurrent_store/store time: [202.45 ns 206.16 ns 209.80 ns]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) low mild
concurrent_store/cache time: [822.62 ps 834.11 ps 844.71 ps]
Found 5 outliers among 100 measurements (5.00%)
5 (5.00%) low mild
utilities/access-map time: [3.2963 ns 3.2982 ns 3.3001 ns]
Found 17 outliers among 100 measurements (17.00%)
2 (2.00%) low severe
11 (11.00%) low mild
2 (2.00%) high mild
2 (2.00%) high severe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple version
r1 = one reader
r3 = three readers
l3 = three leasers
rw = one reader one writer
w2 = two writers
arc_swap_b_read/r1 time: [40.555 ns 40.615 ns 40.688 ns]
arc_swap_b_read/l3 time: [101.76 ns 102.92 ns 104.04 ns]
arc_swap_b_read/rw time: [48.964 ns 49.516 ns 50.106 ns]
arc_swap_b_read/w2 time: [24.000 ns 24.345 ns 24.707 ns]
arc_swap_b_write/r1 time: [241.98 ns 242.83 ns 243.59 ns]
arc_swap_b_write/r3 time: [364.94 ns 365.52 ns 366.11 ns]
arc_swap_b_write/l3 time: [412.31 ns 416.93 ns 421.61 ns]
arc_swap_b_write/rw time: [519.15 ns 519.51 ns 519.92 ns]
arc_swap_b_write/w2 time: [726.34 ns 728.98 ns 730.62 ns]
rwlock_read/r1 time: [52.851 ns 52.969 ns 53.084 ns]
rwlock_read/l3 time: [109.31 ns 110.29 ns 111.51 ns]
rwlock_read/w2 time: [168.34 ns 178.75 ns 189.45 ns]
rwlock_write/rw time: [348.43 ns 358.33 ns 367.91 ns]
rwlock_write/r1 time: [219.27 ns 224.13 ns 229.25 ns]
rwlock_write/r3 time: [1.3608 µs 1.3888 µs 1.4162 µs]
rwlock_write/l3 time: [1.2301 µs 1.2708 µs 1.3116 µs]
rwlock_write/rw time: [348.43 ns 358.33 ns 367.91 ns]
rwlock_write/w2 time: [481.91 ns 484.45 ns 487.17 ns]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most quicker (write/r3 300% & read/r1 120%), few slower(write/w2 80%).
/// support udp or not | ||
fn handle_udp(&self) -> bool; | ||
async fn listen_tcp(&self) -> anyhow::Result<()>; | ||
async fn listen_udp(&self) -> anyhow::Result<()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we prefer anyhow::Result over std::io::Result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsqStephenZhang Asked this question, I answer here for convience.
Because std::io::Error just cannot cover all error cases!
There are many errors are not io::Error but converted into io Error.
Inbound UDP not support
for a start:
Err(io::Error::new(io::ErrorKind::Other, "unsupported")) |
In future there will be more inbounds, tun, tuic, shadowsocks. They may occurs IncorrectConfig/CertificateInvalid/TunDeviceCannotBeCreated which are not io::Error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then why not define more robust error type with thiserror?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically speaking,when we define a Error for a trait, We cannot acknowledge ALL the possible specific Error of the trait's all implementations.
If we have to do it(by using thiserror). The definition of Error might be
enum Error {
HttpInboundError(inbound::http::Error),
SocksInboundError(inbound::socks::Error),
TproxyInboundError(inbound::tproxy::Error),
......
}
I dont think it's different from anyhow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I would like use #717 solution if it's merged into master. But for now using anyhow isn't so bad.
Just as tolnay said in thiserror README
Use thiserror if you care about designing your own dedicated error type(s) so that the caller receives exactly the information that you choose in the event of failure.
In our case, the caller of InboundHandler (which is inbound manager) doesn't care about the type of error at all. It just print the error into logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough, anyhow is ok for us at the current stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome
No description provided.