Skip to content

Benchmarks fix - #1

Merged
Wraith2 merged 3 commits into
Wraith2:masterfrom
adamsitnik:benchmarksFix
Jan 30, 2019
Merged

Wraith2 merged 3 commits into
Wraith2:masterfrom
adamsitnik:benchmarksFix

Conversation

@adamsitnik

Copy link
Copy Markdown
Contributor

This is a fix for dotnet/BenchmarkDotNet#954

To tell the long story short, all you need to do right now to run against local CoreFX build is providing the path to CoreRun.exe via --coreRun console line argument.

It's important to provide the path to the right CoreRun.exe, because CoreFX\artifacts\bin has at least few of them.

The right one is: artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe

Which one is the right one? The one where CoreFX build puts updated dlls after every CoreFX rebuild. For example: you change System.Collections.Immutable.dll and rebuild CoreFX, then the scripts are going to update System.Collections.Immutable.dll in artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\

How it works? When we use CoreRun.exe to run a .NET dll it does not care what it references, it loads the .dlls from it's folder first. So when you reference System.ABC.dll v 4.5 but CoreRun has System.ABC v 4.5.1 then it's going to load and use 4.5.1.

How to run the benchmarks:

dotnet run -c Release --filter * --coreRun "C:\Projects\corefx_fresh\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe"

Sample output from my machine:

PS C:\Projects\SqlBench> dotnet run -c Release --filter * --coreRun "C:\Projects\corefx_fresh\artifacts\bin\runtime\netcoreapp-Windows_NT-Release-x64\CoreRun.exe"
C:\Projects\SqlBench\SqlBench.csproj : warning NU1603: SqlBench depends on System.Data.SqlClient (>= 4.7.0-dev.18621.1) but System.Data.SqlClient 4.7.0-dev.18621.1 was not found. An approximate best match of System.Data.SqlClient 4.7.0-preview.18551.3 was resolved.
C:\Projects\SqlBench\SqlBench.csproj : warning NU1603: SqlBench depends on System.Data.SqlClient (>= 4.7.0-dev.18621.1) but System.Data.SqlClient 4.7.0-dev.18621.1 was not found. An approximate best match of System.Data.SqlClient 4.7.0-preview.18551.3 was resolved.
// Validating benchmarks:
// ***** BenchmarkRunner: Start   *****
// ***** Building 1 exe(s) in Parallel: Start   *****
// start dotnet restore  /p:UseSharedCompilation=false in C:\Projects\SqlBench\bin\Release\netcoreapp3.0\7a8bcd11-9cfe-4510-bb7d-8f076dfc868b
// command took 2,02s and exited with 0
// start dotnet build -c Release  --no-restore /p:UseSharedCompilation=false in C:\Projects\SqlBench\bin\Release\netcoreapp3.0\7a8bcd11-9cfe-4510-bb7d-8f076dfc868b
// command took 3,51s and exited with 0
// start dotnet publish -c Release  --no-build --no-restore /p:UseSharedCompilation=false in C:\Projects\SqlBench\bin\Release\netcoreapp3.0\7a8bcd11-9cfe-4510-bb7d-8f076dfc868b
// command took 1,46s and exited with 0
// ***** Done, took 00:00:07 (7.97 sec)   *****
// Found benchmarks:
//   WriteBenchmarks.SyncGuid: Job-FIHGCA(Runtime=Core, Toolchain=CoreRun, InvocationCount=1, UnrollFactor=1)

// **************************
// Benchmark: WriteBenchmarks.SyncGuid: Job-FIHGCA(Runtime=Core, Toolchain=CoreRun, InvocationCount=1, UnrollFactor=1)
// *** Execute ***
// Launch: 1 / 1
// Execute: C:\Projects\corefx_fresh\artifacts\bin\runtime\4393309a-0981-487b-a1d1-0714f6642318\CoreRun.exe "7a8bcd11-9cfe-4510-bb7d-8f076dfc868b.dll" --benchmarkName "BenchmarkSqlWrite.WriteBenchmarks.SyncGuid" --job "Runtime=Core, Toolchain=CoreRun, InvocationCount=1, UnrollFactor=1" --benchmarkId 0 in C:\Projects\SqlBench\bin\Release\netcoreapp3.0\7a8bcd11-9cfe-4510-bb7d-8f076dfc868b\bin\Release\netcoreapp3.0\publish
// BeforeAnythingElse

// Benchmark Process Environment Information:
// Runtime=.NET Core ? (CoreCLR 4.6.27302.02, CoreFX 4.7.19.5301), 64bit RyuJIT
// GC=Concurrent Workstation
// Job: Job-RJYJTV(Runtime=Core, InvocationCount=1, UnrollFactor=1)

@Wraith2

Wraith2 commented Jan 30, 2019

Copy link
Copy Markdown
Owner

Thanks, sorry for the delay.

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.

2 participants