-
Notifications
You must be signed in to change notification settings - Fork 123
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
fix: Don't initialize regex on each call to stream_readable
#1915
Conversation
Each call takes ~1ms.
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.
👍
Additional background: https://docs.rs/regex/latest/regex/#avoid-re-compiling-regexes-especially-in-a-loop
Benchmark resultsPerformance differences relative to ea1b2bb. coalesce_acked_from_zero 1+1 entries: 💔 Performance has regressed.time: [195.49 ns 195.98 ns 196.51 ns] change: [+1.7379% +2.1198% +2.5532%] (p = 0.00 < 0.05) Found 19 outliers among 100 measurements (19.00%) 7 (7.00%) low mild 5 (5.00%) high mild 7 (7.00%) high severe coalesce_acked_from_zero 3+1 entries: Change within noise threshold.time: [238.40 ns 238.86 ns 239.38 ns] change: [+0.9565% +1.3417% +1.7560%] (p = 0.00 < 0.05) Found 11 outliers among 100 measurements (11.00%) 11 (11.00%) high severe coalesce_acked_from_zero 10+1 entries: Change within noise threshold.time: [237.98 ns 238.61 ns 239.43 ns] change: [+0.8643% +1.4298% +2.0239%] (p = 0.00 < 0.05) Found 7 outliers among 100 measurements (7.00%) 1 (1.00%) low mild 1 (1.00%) high mild 5 (5.00%) high severe coalesce_acked_from_zero 1000+1 entries: 💔 Performance has regressed.time: [219.03 ns 219.18 ns 219.36 ns] change: [+1.2190% +1.9219% +2.6838%] (p = 0.00 < 0.05) Found 11 outliers among 100 measurements (11.00%) 4 (4.00%) high mild 7 (7.00%) high severe RxStreamOrderer::inbound_frame(): No change in performance detected.time: [118.66 ms 118.73 ms 118.80 ms] change: [-0.0337% +0.0937% +0.2196%] (p = 0.15 > 0.05) Found 6 outliers among 100 measurements (6.00%) 6 (6.00%) high mild transfer/Run multiple transfers with varying seeds: Change within noise threshold.time: [118.68 ms 118.93 ms 119.19 ms] thrpt: [33.561 MiB/s 33.632 MiB/s 33.703 MiB/s] change: time: [-1.3785% -1.0728% -0.7751%] (p = 0.00 < 0.05) thrpt: [+0.7812% +1.0845% +1.3978%] 1-conn/1-100mb-resp (aka. Download)/client: No change in performance detected.time: [1.1278 s 1.1389 s 1.1521 s] thrpt: [86.800 MiB/s 87.802 MiB/s 88.672 MiB/s] change: time: [-0.1269% +2.6364% +5.4996%] (p = 0.09 > 0.05) thrpt: [-5.2129% -2.5687% +0.1271%] Found 1 outliers among 10 measurements (10.00%) 1 (10.00%) high mild 1-conn/10_000-parallel-1b-resp (aka. RPS)/client: Change within noise threshold.time: [393.97 ms 397.88 ms 401.78 ms] thrpt: [24.889 Kelem/s 25.133 Kelem/s 25.383 Kelem/s] change: time: [+0.4574% +1.6950% +2.9522%] (p = 0.01 < 0.05) thrpt: [-2.8676% -1.6667% -0.4553%] Found 2 outliers among 100 measurements (2.00%) 2 (2.00%) high mild 1-conn/1-1b-resp (aka. HPS)/client: No change in performance detected.time: [41.733 ms 41.848 ms 41.983 ms] thrpt: [23.819 elem/s 23.896 elem/s 23.962 elem/s] change: time: [-0.4827% -0.0753% +0.3513%] (p = 0.73 > 0.05) thrpt: [-0.3501% +0.0753% +0.4851%] Found 26 outliers among 100 measurements (26.00%) 3 (3.00%) low severe 17 (17.00%) low mild 4 (4.00%) high mild 2 (2.00%) high severe Client/server transfer resultsTransfer of 33554432 bytes over loopback.
|
Each call takes ~1ms.