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

Support measuring the cost of hooks and events #39

Merged
merged 4 commits into from
Nov 19, 2022
Merged

Support measuring the cost of hooks and events #39

merged 4 commits into from
Nov 19, 2022

Conversation

vweevers
Copy link
Member

@vweevers
Copy link
Member Author

vweevers commented Nov 1, 2022

To make it easier to compare results, I added a way to collect ops/sec and print it as a table. Only for the put benchmark, to start:

$ level-bench.js run put ..\memory-level
$ level-bench.js run put ..\memory-level --events [ --put=1 ]
$ level-bench.js run put ..\memory-level-hooks --hooks [ --prewrite=1 ]
$ ...

$ level-bench plot put
benchmark put on memory-level@1.0.0 win32 x64
node@16.9.1 n=1M concurrency=4 valueSize=100B keys=random values=random

1  memory-level#hooks                      36588 ops/s ±8.51%  fastest
2  memory-level#main                       35837 ops/s ±8.12%   +1.70%
3  memory-level#hooks  hooks.prewrite=1    35286 ops/s ±6.51%   +1.75%
4  memory-level#main   events.put=1        35508 ops/s ±7.47%   +2.01%
5  memory-level#hooks  events.write=1      34692 ops/s ±6.83%   +3.69%
6  memory-level#hooks  hooks.prewrite=100  34302 ops/s ±8.28%   +6.05%

@vweevers vweevers merged commit ad235fd into master Nov 19, 2022
@vweevers vweevers deleted the hooks branch November 19, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant