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

Implement apples to apples comparison mode #2116

Merged
merged 2 commits into from
Sep 22, 2022
Merged

Conversation

adamsitnik
Copy link
Member

Sample:

public class IntroApplesToApples
{
    private readonly string path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
    private readonly string content = new string('a', 100_000);

    [Benchmark]
    public void WriteAllText() => File.WriteAllText(path, content);

    [GlobalCleanup]
    public void Delete() => File.Delete(path);
}
dotnet run -c Release -f net6.0 --filter *IntroApplesToApples* --apples --runtimes net6.0 net7.0 --iterationCount 20 --statisticalTest 5%

It runs every benchmark for just one iteration, just so the Pilot Stage can estimate invocation count:

image

Then for every job defined in the config, it runs the benchmarks again, but using exact same invocation count:

image

image

Users can at the same time use one of the built-in profilers or provide their own or don't use any profiler at all.

cc @mrsharm @Maoni0

@adamsitnik adamsitnik added this to the v0.13.3 milestone Sep 21, 2022
@adamsitnik
Copy link
Member Author

I am going to merge it now and later improve it and add docs, once I verify that this solves the problem we have.

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.

1 participant