-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add change-counting benchmark #369
base: main
Are you sure you want to change the base?
Conversation
The motivation behind the hitherto latest commit stems from an observation that the scaling of the parallelism becomes more visible when the number of denominations in the I had previously ran these benchmarks with coins input of size 1400 Looking at the results from running the multicore version, it seems like performance peaks as the number of cores and denominations are roughly equal to one another.
|
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.
Thanks! This is a great addition to the set of parallel bench.
Left some comments below. Switching from tuples to records would simplify the code IMO.
| _ -> aux (L.tl c) (((amt, c, []))::stack) in | ||
aux coins [] | ||
|
||
let coins_input : (int * int) list = |
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.
The tuple here could be replaced with a record such as:
type coin = { denom : int; num : int; }
This would make it easier to read what's stored in the tuple.
This PR adds a combinatorial benchmark that enumerates the all the possible way to distribute change to pay a given amount. The relevant config files have also been updated.