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

Generate one executable per runtime settings #699

Closed
adamsitnik opened this issue Mar 22, 2018 · 5 comments
Closed

Generate one executable per runtime settings #699

adamsitnik opened this issue Mar 22, 2018 · 5 comments
Assignees
Milestone

Comments

@adamsitnik
Copy link
Member

Today we generate, build and execute new project per every benchmark.

What I want to do is: take all the benchmarks that have the same runtime settings (GC, Jit, .NET framework) and create a single executable for all of them. Then run executable per benchmark (but just tell it which benchmark to run). (In the future: run them in parallel if user wants to == optional feature)

Why: I want to run thousands of benchmarks as part of the CI and spending few seconds per benchmark for build is very expensive.

Moreover, I want to implement local coreclr toolchain which needs a lot of time to compile (I will be using dotnet restore --packages folder) so the gain will be even bigger.

@AndreyAkinshin
Copy link
Member

In the future: run them in parallel if user wants to

Great idea!

@adamsitnik
Copy link
Member Author

adamsitnik commented Mar 24, 2018

@AndreyAkinshin done!

Pseudo code:

  1. Take all benchmarks, group them by runtime settings (jit/gc/runtime etc) into partitions
  2. Build single .exe for each partition
  3. Each bechmarks gets a unique benchmark Id per partition
  4. When running bechmark tell the process which type to load by providing the id.

Time to build all (more than 650) benchmarks from our Samples project: 13s.

@AndreyAkinshin
Copy link
Member

Awesome! I guess it's the most impressive perf improvement in BenchmarkDotNet ever!

However, I should ask: do you a have a setting in Config which disables this behavior? (It can be useful for debug).

@adamsitnik
Copy link
Member Author

Currently what I do is:

  1. [KeepBenchmarkFiles]
  2. Run single benchmark
  3. Find the .exe file and run it with -0 argument

@AndreyAkinshin is that enough? It's just a matter of passing the right Id

@adamsitnik
Copy link
Member Author

@AndreyAkinshin I will be now working on #700 so there will be a lot of build artifacts related debugging.
If my current approach will not be enough I will improve it.

All builds are green, it works so now I am closing this one.

adamsitnik added a commit that referenced this issue Mar 27, 2018
This was referenced Apr 10, 2018
Merged
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
alinasmirnova pushed a commit to alinasmirnova/BenchmarkDotNet that referenced this issue Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants