-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: performance fix #34
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lambdalisue
force-pushed
the
performance-fix
branch
from
August 16, 2024 21:02
23581b6
to
742c910
Compare
lambdalisue
force-pushed
the
performance-fix
branch
3 times, most recently
from
August 16, 2024 21:22
02617d0
to
14272f6
Compare
It seems `using` in Node is not as performant as expected. Note that the performance in Deno seems not to be affected by this change. benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Lock#lock v1.0.0 52.84 ms/iter 18.9 (45.86 ms … 57.58 ms) 55.68 ms 57.58 ms 57.58 ms main 53.55 ms/iter 18.7 (47.32 ms … 73.59 ms) 55.52 ms 73.59 ms 73.59 ms summary v1.0.0 1.01x faster than main See #31 for detail
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Semaphore#lock current 231.08 µs/iter 4,327.5 (207 µs … 565.42 µs) 214.17 µs 491.58 µs 503.88 µs v1.0.0 21.07 ms/iter 47.5 (20.46 ms … 23.17 ms) 21.06 ms 23.17 ms 23.17 ms summary current 91.18x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Mutex#wait current 395.68 µs/iter 2,527.3 (361.25 µs … 1.31 ms) 374.62 µs 716.46 µs 733.62 µs v1.0.0 52.76 ms/iter 19.0 (46.67 ms … 56.59 ms) 55.51 ms 56.59 ms 56.59 ms summary current 133.33x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Lock#lock current 231.74 µs/iter 4,315.2 (206.46 µs … 700.42 µs) 215.5 µs 488.58 µs 505.96 µs v1.0.0 52.28 ms/iter 19.1 (47.25 ms … 55.24 ms) 54.78 ms 55.24 ms 55.24 ms summary current 225.59x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group RwLock#lock current 270.64 µs/iter 3,695.0 (247.21 µs … 681.58 µs) 257.83 µs 508.83 µs 532.21 µs v1.0.0 52.87 ms/iter 18.9 (47.98 ms … 57.47 ms) 55.87 ms 57.47 ms 57.47 ms summary current 195.35x faster than v1.0.0 group RwLock#rlock current 201.44 µs/iter 4,964.4 (182.46 µs … 1.18 ms) 189.58 µs 445.92 µs 474.75 µs v1.0.0 57.84 ms/iter 17.3 (52.11 ms … 78.27 ms) 59.24 ms 78.27 ms 78.27 ms summary current 287.13x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Barrier#wait current 61.42 µs/iter 16,280.8 (56.54 µs … 270.25 µs) 61.75 µs 129.17 µs 137.71 µs v1.0.0 251.46 µs/iter 3,976.7 (206.38 µs … 577.12 µs) 232.12 µs 518.33 µs 528.71 µs summary current 4.09x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Notify#notifyAll current 293.47 µs/iter 3,407.5 (251.46 µs … 676.88 µs) 266.04 µs 592.96 µs 608.17 µs v1.0.0 223.93 µs/iter 4,465.6 (200.75 µs … 452.79 µs) 215.67 µs 356.75 µs 370.08 µs summary current 1.31x slower than v1.0.0 group Notify#notify current 395.51 µs/iter 2,528.4 (344.42 µs … 953.71 µs) 365.83 µs 700.67 µs 717.75 µs v1.0.0 21.54 ms/iter 46.4 (20.82 ms … 23.01 ms) 21.89 ms 23.01 ms 23.01 ms summary current 54.46x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Queue#push/pop current 154.58 µs/iter 6,469.2 (146 µs … 425.71 µs) 151.83 µs 272.96 µs 297.25 µs v1.0.0 1.1 ms/iter 909.4 (917.17 µs … 5.96 ms) 993.5 µs 3.44 ms 3.58 ms summary current 7.11x faster than v1.0.0
benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group Stack#push/pop current 112.37 µs/iter 8,898.9 (100.12 µs … 348.71 µs) 111.25 µs 217.75 µs 225.96 µs v1.0.0 1.07 ms/iter 938.4 (882.54 µs … 3.94 ms) 969.21 µs 3.35 ms 3.55 ms summary current 9.48x faster than v1.0.0
lambdalisue
force-pushed
the
performance-fix
branch
from
August 17, 2024 12:29
14272f6
to
2ce4940
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 92.11% 92.91% +0.79%
==========================================
Files 12 13 +1
Lines 355 395 +40
Branches 41 37 -4
==========================================
+ Hits 327 367 +40
Misses 28 28 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continue from #31