grpc / grpc/grpc-dotnet

Remove Microbenchmarks .NET 6 hard-coded toolchain

Open
#2,680 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

I've tried to run the microbenchmarks locally and ran into the following error while generating the BDN boilerplate code:

```
Standard error:
Determining projects to restore...
C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\bin\Release\net10.0\Grpc.AspNetCore.Microbenchmarks-1\BenchmarkDotNet.Autogenerated.csproj : error NU1201: Project Grpc.AspNetCore.Microbenchmarks is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Project Grpc.AspNetCore.Microbenchmarks supports: net10.0 (.NETCoreApp,Version=v10.0)
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Core.Api\Grpc.Core.Api.csproj (in 173 ms).
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Net.Common\Grpc.Net.Common.csproj (in 173 ms).
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Net.Client\Grpc.Net.Client.csproj (in 177 ms).
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj (in 167 ms).
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.AspNetCore.Server.ClientFactory\Grpc.AspNetCore.Server.ClientFactory.csproj (in 167 ms).
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.AspNetCore\Grpc.AspNetCore.csproj (in 182 ms).
Restored C:\Personal\Repositories\grpc-dotnet\src\Grpc.Net.ClientFactory\Grpc.Net.ClientFactory.csproj (in 184 ms).
Failed to restore C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\bin\Release\net10.0\Grpc.AspNetCore.Microbenchmarks-1\BenchmarkDotNet.Autogenerated.csproj (in 148 ms).
Restored C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\Grpc.AspNetCore.Microbenchmarks.csproj (in 200 ms).

// BenchmarkDotNet has failed to build the auto-generated boilerplate code.
// It can be found in C:\Personal\Repositories\grpc-dotnet\perf\Grpc.AspNetCore.Microbenchmarks\bin\Release\net10.0\Grpc.AspNetCore.Microbenchmarks-1
// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html
```

For the context, I don't have .NET6 runtime/sdk installed.

The issue is that the .NET 6 toolchain is hard-coded [here](https://github.com/grpc/grpc-dotnet/blob/master/perf/Grpc.AspNetCore.Microbenchmarks/DefaultCoreConfig.cs#L46), which was introduced in da6dcc5ca21ac272589bc31c8bc38be541b7eda7. I suppose it was done because at that time BDN didn’t support .NET 6 targets.

This issue can be worked around by running benchmarks specifying a concrete runtime, e.g.: `dotnet run -c Release -- --runtimes net10.0`

However, it still outputs broken .NET 6 target results:

Image

How about removing that hard-coded toolchain target?

Contributor guide

Open the contributing guide

Research direction

Start in perf/Grpc.AspNetCore.Microbenchmarks/DefaultCoreConfig.cs at the hard-coded .NET 6 toolchain, then run the microbenchmarks with the available runtime using the command shown in the issue. Done means the default benchmark configuration no longer requires an installed .NET 6 SDK and does not produce broken .NET 6 target results.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
performance, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.