Skip to content

Conversation

@PEZ
Copy link
Collaborator

@PEZ PEZ commented Jan 25, 2025

Couldn't reopen #365, so a new PR. 😄

I have:

  • Read the project README, including the benchmark descriptions
  • Read the PR template instructions before I deleted them
  • Understood that if I have changed something that could impact performance of one or more contributions, I should provide results benchmark runs, using the run.sh script, from before and after the change.

Description of changes

This is the start of what I said in #341 that I should try to implement in-process benchmarking for Clojure, Java, and C. Starting with Clojure, to get it as right as possible before cloning the approach to any other languages.

I think the changes are best described in the New runner section in the updated README.md, plus:

Addressing:

PEZ added 30 commits January 23, 2025 21:26
…on times instead of a cut-off on current time
@PEZ PEZ requested a review from bddicken January 25, 2025 00:26
@PEZ PEZ merged commit 6c53bdb into bddicken:main Jan 25, 2025
1 check passed
@PEZ PEZ added levenshtein Anything regarding the levenshtein benchmark/test correctness Things touching upon the issue of program correctness loops Anything regarding the loops benchmark/test fibonacci Anything regarding the fibonacci benchmark/test start-times Issues regarding start-times as part of the benchmarks hello-world Anything regarding the hello-world benchmark/test in-process-benching labels Jan 25, 2025
You'll see that the `benchmark/run` function takes two arguments:

1. `f`: A function (a thunk)
1. `run-ms`: A total time in milliseconds within which the function should be run as many times as possible
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make sure you're using a monotonic clock for these measurements (wall clock time can jump around).

I don't know how this actually works in other languages, but in Racket you can provide a time-limit for a body of execution (see call-with-time-limit).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I made sure it was a monotonic clock for Java and Clojure, but I shall now check the other language implementations. It's probably fine, but I didn't pay attention to that so could have slipped in some wall clocking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

correctness Things touching upon the issue of program correctness fibonacci Anything regarding the fibonacci benchmark/test hello-world Anything regarding the hello-world benchmark/test levenshtein Anything regarding the levenshtein benchmark/test loops Anything regarding the loops benchmark/test start-times Issues regarding start-times as part of the benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants