-
-
Notifications
You must be signed in to change notification settings - Fork 983
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
MinIterationTime, WarmupCount, and tiered JIT #1993
Comments
@adamsitnik, @EgorBo do you have any thoughts on this? |
Most likely there is a magic env var that allows for that already. The problem is that it would most likely promote all the methods, even those who don't meet the "promotion requirements" (invoked too few times)?
I agree, it would be tricky to implement, and it could have some overhead (logging events)
I like this idea. It should work well as long as the JIT heuristic does not change. @AndyAyersMS @kouvel is it still 30 invocations and 100 ms of no new methods being JITted? |
After 100 ms of no new methods being called, call counting then begins and after 30 calls the method would be queued for promotion to tier 1 in the background.
There is an env var |
Unless you've manually enabled |
Currently, I'm working on reducing the default value for
MinIterationTime
(the current value is 500 ms). I believe that we could achieve the same level of accuracy with a lower value ofMinIterationTime
that will allow us to significantly reduce the total benchmarking time. The only issue I observe right now is about the tiered JIT. Let's consider the following benchmark:Here are the results on my machine:
As we can see, the increased number of
WarmupCount
gives another result. Now let's look at the logs:On iteration 58, JIT promoted the benchmark to the next tier (we can observe an obvious speedup). Potentially, this issue could be relevant for some benchmarks even with the default
MinIterationTime
value (I wasn't able to come up with an example). While the issue could be considered as a corner case for the current settings, it becomes a serious problem for lowerMinIterationTime
values.Currently, I see three ways to resolve this problem:
MinTotalWarmupDuration
so that BenchmarkDotNet will always spend enough time in the warmup stage regardless of theInvocationCount
/MinIterationTime
.The latest option looks the most promising because it's runtime-agnostic. However, it requires choosing a proper default value for
MinTotalWarmupDuration
.Relevant issues: #1125, #1210, #1466, dotnet/runtime#13069
The text was updated successfully, but these errors were encountered: