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

Benchmarks for individual dynamics functions #577

Merged
merged 6 commits into from
Sep 26, 2024

Conversation

maximilian-gelbrecht
Copy link
Member

@maximilian-gelbrecht maximilian-gelbrecht commented Sep 25, 2024

I added the individual dynamics functions as another benchmark suite as in #525. I had to change a few things around because they didn’t fit in the existing BenchmarkSuite scheme.

I use BenchmarkTools which isn’t in the main environment, so I added a new local environment. This isn’t working ideally because the Project.toml doesn’t know that Speedy was added with dev ... Maybe we should add the Manifest.toml as well here, or you know, just be aware of it when executing the benchmarks.

@maximilian-gelbrecht maximilian-gelbrecht added performance 🚀 Faster faster! testing 🧪 How we test things and continuous integration labels Sep 25, 2024
@milankl
Copy link
Member

milankl commented Sep 25, 2024

I use BenchmarkTools which isn’t in the main environment, so I added a new local environment. This isn’t working ideally because the Project.toml doesn’t know that Speedy was added with dev ... Maybe we should add the Manifest.toml as well here, or you know, just be aware of it when executing the benchmarks.

In practice this just means someone has to have BenchmarkTools in their environment and it's not automatically installed no? Because I wouldn't find that thaaat problematic given how mature and widely used BenchmarkTools is

@@ -1,6 +1,6 @@
# Benchmarks

created for SpeedyWeather.jl v0.9.0 on Tue, 02 Apr 2024 14:05:51.
created for SpeedyWeather.jl v0.10.0 on Wed, 25 Sep 2024 18:36:59.
Copy link
Member

Choose a reason for hiding this comment

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

Should we already change the version to 0.11 here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, makes sense. It's a major change, and some of it is also user facing (the output)

Copy link
Member

Choose a reason for hiding this comment

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

Happy for you to already bump the version number in this pull request?

t = median(trial)

suite.time_median[i_run][i_func] = t.time
Copy link
Member

Choose a reason for hiding this comment

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

Is median what's typically printed with @btime? I thought that was lowest?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, you are right @btime prints the minimum. I didn't know that before. @benchmark prints range, median and mean. Any way, not that it matters a lot, but I'd still prefer median.

Copy link
Member

Choose a reason for hiding this comment

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

I believe in benchmarking the minimum is often used because it is more robust because that's the most uninterrupted execution of this code

Copy link
Member Author

@maximilian-gelbrecht maximilian-gelbrecht Sep 26, 2024

Choose a reason for hiding this comment

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

Ok, I'll take the minimum. I also see now that it's BenchmarkTools default for time(t::Trial) as well

@maximilian-gelbrecht maximilian-gelbrecht merged commit aad3f18 into main Sep 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance 🚀 Faster faster! testing 🧪 How we test things and continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants