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

Rewrite or refactor benchmarks using multicore-bench #120

Merged
merged 1 commit into from
Feb 17, 2024
Merged

Conversation

polytypic
Copy link
Contributor

@polytypic polytypic commented Jan 12, 2024

This PR changes the benchmarks to use the multicore-bench framework.

This PR also adds a bench.Dockerfile to run the benchmarks on OCaml 5.1 (rather than the default OCaml 5.0).

See also:


It is clear that many of the data structure implementations currently suffer from false sharing and some other performance pitfalls. I briefly experimented with some optimizations (avoiding false sharing, avoiding indirections, avoiding contention by using a caching mechanism) and was able to e.g. get the spsc queue to perform more than order of magnitude better (from 15M/s to over 200M/s) on my M3 Max laptop. I'm, however, intentionally leaving the proper implementation of these optimizations for future work.

@polytypic polytypic force-pushed the rewrite-bench branch 22 times, most recently from 7c80e1e to 40c5ee2 Compare January 14, 2024 11:49
@polytypic polytypic changed the title Rewrite or refactor benchmarks using multicore-bench WIP: Rewrite or refactor benchmarks using multicore-bench Jan 14, 2024
@polytypic polytypic marked this pull request as ready for review January 14, 2024 14:03
@polytypic polytypic requested a review from a team January 14, 2024 14:06
@polytypic polytypic force-pushed the rewrite-bench branch 4 times, most recently from 99cb6c4 to 17854f9 Compare January 16, 2024 09:31
@polytypic polytypic force-pushed the rewrite-bench branch 15 times, most recently from 877e08a to b426183 Compare January 20, 2024 10:11
@polytypic polytypic changed the title WIP: Rewrite or refactor benchmarks using multicore-bench Rewrite or refactor benchmarks using multicore-bench Jan 24, 2024
Copy link
Collaborator

@lyrm lyrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. Multicore-bench is a way more readable framework than what we had before. That will make benchmarks more useful and hopefully less painful to write :)

Also, I like the ws_queue bench with Fibonacci. I will probably use this to write an example on how to use this queue.

@polytypic polytypic merged commit e2822ff into main Feb 17, 2024
6 checks passed
@polytypic polytypic deleted the rewrite-bench branch February 17, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants