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

Remove benchmark dependency from the runner #1038

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

Earlopain
Copy link
Contributor

Ruby wants to bundle it: ruby/ruby#11492, which means that the next ruby release will warn and the one after that will error, unless it is added to the gemspec. Usage is trivial and can simply be inlined.

The benchmark gem does it like this for 14 years already so I don't imagine compatibility problems with older ruby versions: https://github.com/ruby/benchmark/blame/0383673a9089d6a74a73ef37c67d5afc15d66d71/lib/benchmark.rb#L277-L287

Test with bin/ruby-parse lib/parser/ruby34.rb --bench.

@iliabylich
Copy link
Collaborator

Thanks. Do you know whether Process.times.utime uses monotonic time? If not could you replace it with Process.clock_gettime(Process::CLOCK_MONOTONIC) please?

Ruby wants to bundle it: ruby/ruby#11492

The benchmark gem does it like this for 14 years already so I don't imagine
problems with older ruby versions
@Earlopain
Copy link
Contributor Author

I believe it is but CLOCK_MONOTONIC seems more correct anyways. You basically want the cumulative of these https://ruby-doc.org/3.3.4/Process.html#method-c-times. I don't think it matters much in this context butI switched it over 👍

@iliabylich iliabylich merged commit 55c6aab into whitequark:master Aug 29, 2024
9 checks passed
@iliabylich
Copy link
Collaborator

Thank you very much!

@Earlopain Earlopain deleted the remove-benchmark-dep branch August 29, 2024 16:39
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