-
-
Notifications
You must be signed in to change notification settings - Fork 979
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
Allow baseline per category #617
Comments
I like this idea! @AndreyAkinshin what about you? |
I think that it's better to introduce a unified way for grouping results. In each group, we should get exactly one baseline.
With a "unified grouping approach", it should be easy to write simple API for specific use cases (e.g. A few additional thoughts:
It's a definitely a very useful feature and it should be easy to implement it (I guess, I need one hour for the first proof-of-concept implementation). The most difficult task here is simple, obvious, and user-friendly API and the summary table presentation. Any thoughts? |
An extra double-line / separator row in a single table may be more than
sufficient, to avoid repetitive column headers and other space issues
…On 9 Jan 2018 6:30 p.m., "Andrey Akinshin" ***@***.***> wrote:
I think that it's better to introduce a unified way for grouping results.
In each group, we should get exactly one baseline.
Here are some use cases for it:
1. Compare the performance of different methods (current default
basline behavior).
2. Compare the performance of different methods in a category (this
issue).
3. Compare the performance of the same method for different jobs (e.g.
.NET Core vs. .NET Framework for the same method).
4. Compare the performance of the same method for different param
values (e.g. I have a CacheStrategy enum property and I would like to
compare different strategies for the same method).
5. A combination of these use cases.
With a "unified grouping approach", it should be easy to write simple API
for specific use cases (e.g. SplitResultsByCategory).
A few additional thoughts:
- Such "grouping" should be useful not only for baselines but also for
ranking <http://benchmarkdotnet.org/Configs/Columns.htm#ranking>
- The feature should be combined with OrderProviders
<http://benchmarkdotnet.org/Configs/OrderProvider.htm> (we should be
able to order lines inside each group and order the groups)
- Grouping should be obvious (when I look at 0.34 in the baseline
column, it should be obvious where is the 1.0 value for this line;
when I look at 5 in the rank column, it should be obvious where are
the 1, 2, 3, 4 which correspond to this line). I like the approach by
@mgravell <https://github.com/mgravell> with several tables, but I'm a
little concerned that this approach takes too much space. It would be great
to keep one table for all results, but I don't know how to make grouping
obvious for all users (especially for those who look at the BenchmarkDotNet
summary table for the first time).
It's a definitely a very useful feature and it should be easy to implement
it (I guess, I need one hour for the first proof-of-concept
implementation). The most difficult task here is simple, obvious, and
user-friendly API and the summary table presentation.
Any thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#617 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABDsIrPbHEcuFHiYYxkPFT5vDgMd6U7ks5tI7BNgaJpZM4RXhBU>
.
|
@mgravell, LGTM. |
@AndreyAkinshin LGTM |
For anyone that might end up in this issue while looking for this functionality, the attribute For example, this benchmark: [SimpleJob, GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory), CategoriesColumn]
public class SomeBenchmark
{
[Benchmark(Baseline = true), BenchmarkCategory("fast")]
public async Task FastA()
{
await Task.Delay(100);
}
[Benchmark, BenchmarkCategory("fast")]
public async Task FastB()
{
await Task.Delay(150);
}
[Benchmark(Baseline = true), BenchmarkCategory("slow")]
public async Task SlowA()
{
await Task.Delay(1000);
}
[Benchmark, BenchmarkCategory("slow")]
public async Task SlowB()
{
await Task.Delay(1500);
}
} Will output something like:
|
Edit: if there's already a way to do this and I'm just being ignorant: please say!
Often I'm trying to compare alternative implementations that can impact multiple scenarios - essentially baseline vs option 1 (vs option 2 etc), but for multiple separate tests A, B, C.
The
Baseline = true
feature is great, but only really allows a single baseline. If multiple methods are marked asBaseline
, then the test runner fails and complains at you.However,
[BenchmarkCategory(...)]
exists (via #248). It is currently only used to filter tests to run, but it could be much richer:so instead of:
we could have:
with
Scaled
/ScaledSD
being relative to theBaseline
(if one) in that same category.(*.** is just where I haven't "done the math" by hand; to be clear: "single" and "multi" here are completely different tests - it isn't just more of the same - naming is hard)
If necessary, this could be an opt-in
SplitResultsByCategory
feature on custom options. Or it could be implicit: "there's multiple baselines == split by category" (since this won't have worked previously, this can't change existing working behaviour)The text was updated successfully, but these errors were encountered: