Nbench: μ§€μ •λœ ν”„λ ˆμž„μ›Œν¬ 버전 '2.1'을 ꡬ문 뢄석할 수 μ—†μŠ΅λ‹ˆλ‹€.

에 λ§Œλ“  2018λ…„ 10μ›” 15일  Β·  7μ½”λ©˜νŠΈ  Β·  좜처: petabridge/NBench

dotnet nbench μ•„λž˜ 둜그둜 μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€.

❯ dotnet nbench
Building for framework netcoreapp2.1...
  Benchmark.SimepleOneway.Local -> /SolutionDir/ProjectDir/bin/Release/netcoreapp2.1/Benchmark.SimepleOneway.Local.dll
Running .NET Core 2.1 tests for framework netcoreapp2.1...
OutputDir /SolutionDir/ProjectDir/PerfResults
The specified framework version '2.1' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.1' was not found.
  - Check application dependencies and target a framework version installed at:
      /usr/local/share/dotnet/
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      2.0.9 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
      2.1.3 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
      2.1.5 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
bug benchmark-execution

λͺ¨λ“  7 λŒ“κΈ€

@HIPERCUBE ν™˜κ²½μ— λ¬Έμ œκ°€ μžˆμ„ 수 μžˆμ§€λ§Œ λ‹€μ‹œ ν™•μΈν•˜κ² μŠ΅λ‹ˆλ‹€.

ν”„λ‘œμ νŠΈμ— λŸ°νƒ€μž„ 버전을 μ§€μ •ν•˜λŠ” global.json λ˜λŠ” 기타 ν•­λͺ©μ΄ μžˆμŠ΅λ‹ˆκΉŒ?

dotnet core 2.1둜 NBenchλ₯Ό μ‹€ν–‰ν•˜λŠ” 문제λ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

The specified framework version '2.1' could not be parsed
The specified framework 'Microsoft.NETCore.App', version '2.1' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.3-servicing-26724-03 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

gloabl.json 파일이 μ—†κ³  λ‹€λ₯Έ 2.1 ν”„λ‘œμ νŠΈκ°€ 잘 μ‹€ν–‰λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ 버전 λΆˆμΌμΉ˜κ°€ μžˆλŠ”μ§€ λ‹€μ‹œ ν™•μΈν•˜κΈ° μœ„ν•΄ 2.1 λŸ°νƒ€μž„μ„ μ„€μΉ˜ν–ˆμ§€λ§Œ μ—¬μ „νžˆ μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

도움이 λ˜μ—ˆλ‹€λ©΄ .csproj에 <RuntimeFrameworkVersion>2.1.5</RuntimeFrameworkVersion> λ₯Ό μΆ”κ°€ν•˜λ©΄ λ¬Έμ œκ°€ ν•΄κ²°λ˜μ—ˆμŠ΅λ‹ˆλ‹€(ν¬λ ˆλ”§μ€ https://github.com/dotnet/cli/issues/에 λ‚˜μ—΄λœ μ†”λ£¨μ…˜μ— λŒ€ν•΄ @Rene-Sackersμ—κ²Œ μ œκ³΅λ©λ‹ˆλ‹€. 10111#issuecomment-429014700).

이것은 λ‚΄κ°€ 말할 수 μžˆλŠ” ν•œ dotnet CLI의 문제인 것 κ°™μŠ΅λ‹ˆλ‹€. μ—°κ²°λœ 문제 등을 μ‚΄νŽ΄λ΄…λ‹ˆλ‹€. 여기에 쓰여진 였λ₯˜λŠ” NBenchμ—μ„œ 온 것이 μ•„λ‹ˆλΌ dotnet-nbench κ°€ ν…ŒμŠ€νŠΈ λŸ¬λ„ˆλ₯Ό μ‹€ν–‰ν•˜κΈ° μœ„ν•΄ μƒμ„±ν•˜λŠ” dotnet ν”„λ‘œμ„ΈμŠ€μ—μ„œ λ°œμƒν•œ κ²ƒμž…λ‹ˆλ‹€.

문제의 κ·Όλ³Έ 원인은 ASP.NET Coreμ—μ„œ κ°€μ Έμ˜¨ 이 DotNetMuxer 클래슀λ₯Ό μ‚¬μš©ν•˜μ—¬ dotnet ν”„λ‘œμ„ΈμŠ€λ₯Ό ν˜ΈμΆœν•˜λŠ” 방식일 수 μžˆλ‹€λŠ” λŠλ‚Œμ΄ λ“­λ‹ˆλ‹€.

https://github.com/petabridge/NBench/blob/557f2fbca250a4a45636f5e4b41b58b8440b33f2/src/NBench.Runner.DotNetCli/DotNetMuxer.cs#L1 -L74

μž¬μƒμ‚° ν”„λ‘œμ νŠΈλ₯Ό λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€. https://github.com/Aaronontheweb/NBenchNetCore2.1Repro

dotnet build ν˜ΈμΆœν•œ λ‹€μŒ 거기에 μžˆλŠ” μƒ˜ν”Œ ν”„λ‘œμ νŠΈμ—μ„œ dotnet nbench λ₯Ό ν˜ΈμΆœν•˜λ©΄ λ‹€μŒκ³Ό 같은 좜λ ₯이 λ‚˜νƒ€λ‚©λ‹ˆλ‹€.

Ξ»  dotnet nbench
Building for framework netcoreapp2.1...
  NBenchRepro -> C:\Repositories\NBenchNetCore2.1Repro\NBenchRepro\bin\Release\netcoreapp2.1\NBenchRepro.dll
Running .NET Core 2.1.0 tests for framework netcoreapp2.1...
OutputDir C:\Repositories\NBenchNetCore2.1Repro\NBenchRepro\PerfResults
Executing Benchmarks in C:\Repositories\NBenchNetCore2.1Repro\NBenchRepro\bin\Release\netcoreapp2.1\NBenchRepro.dll
------------ STARTING NBenchRepro.CounterPerfSpecs+Benchmark ----------
--------------- BEGIN WARMUP ---------------
Elapsed: 00:00:00.1657419
[Counter] TestCounter - operations: 25,439,744.00 ,operations: /s 153,490,119.28 , ns / operations: 6.52
--------------- END WARMUP ---------------

--------------- BEGIN WARMUP ---------------
Elapsed: 00:00:00.1663968
[Counter] TestCounter - operations: 25,439,744.00 ,operations: /s 152,886,017.04 , ns / operations: 6.54
--------------- END WARMUP ---------------

--------------- BEGIN WARMUP ---------------
Elapsed: 00:00:00.1670527
[Counter] TestCounter - operations: 25,439,744.00 ,operations: /s 152,285,739.77 , ns / operations: 6.57
--------------- END WARMUP ---------------

--------------- BEGIN RUN ---------------
Elapsed: 00:00:00.1659459
[Counter] TestCounter - operations: 25,439,744.00 ,operations: /s 153,301,431.37 , ns / operations: 6.52
--------------- END RUN ---------------

--------------- BEGIN RUN ---------------
Elapsed: 00:00:00.1654938
[Counter] TestCounter - operations: 25,439,744.00 ,operations: /s 153,720,223.96 , ns / operations: 6.51
--------------- END RUN ---------------

--------------- BEGIN RUN ---------------
Elapsed: 00:00:00.1651669
[Counter] TestCounter - operations: 25,439,744.00 ,operations: /s 154,024,468.58 , ns / operations: 6.49
--------------- END RUN ---------------

--------------- RESULTS: NBenchRepro.CounterPerfSpecs+Benchmark ---------------
Test to ensure that a minimal throughput test can be rapidly executed.
--------------- DATA ---------------
[Counter] TestCounter: Max: 25,439,744.00 operations, Average: 25,439,744.00 operations, Min: 25,439,744.00 operations, StdDev: 0.00 operations
[Counter] TestCounter: Max / s: 154,024,468.58 operations, Average / s: 153,682,041.30 operations, Min / s: 153,301,431.37 operations, StdDev / s: 363,027.74 operations

--------------- ASSERTIONS ---------------
[PASS] Expected [Counter] TestCounter to must be greater than 10,000,000.00 operations; actual value was 153,682,041.30 operations.

------------ FINISHED NBenchRepro.CounterPerfSpecs+Benchmark ----------

이 경우 NBench 1.2.2 및 dotnet --version 2.1.300을 μ‚¬μš©ν•©λ‹ˆλ‹€.

λ”°λΌμ„œ 이것은 과거에 dotnet xunit μ—μ„œ μœ μ‚¬ν•œ λ¬Έμ œκ°€ 자주 λ°œμƒν–ˆλ˜ κ²ƒμ²˜λŸΌ ν™˜κ²½ λ¬Έμ œμ™€ 맀우 μœ μ‚¬ν•©λ‹ˆλ‹€. ν™˜κ²½μ΄ μ–΄λ–»κ²Œ μƒκ²ΌλŠ”μ§€ λ˜λŠ” μž¬μƒμ‚° 사양에 λŒ€ν•œ μΆ”κ°€ 정보λ₯Ό μ œκ³΅ν•΄ μ£Όμ‹œλ©΄ 이 문제λ₯Ό λ‹€μ‹œ μ—΄κ³  κ³„μ†ν•΄μ„œ μ„€λͺ…ν•˜κ² μŠ΅λ‹ˆλ‹€.

κ·Έλ™μ•ˆ @C-Babbage의 μ œμ•ˆμ— 따라 λͺ…μ‹œμ  λŸ°νƒ€μž„ 버전을 μ§€μ •ν•˜μ—¬ ν•΄κ²° 방법을 μ‹œλ„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

이에 λŒ€ν•œ 후속 쑰치 - https://github.com/petabridge/Petabridge.Tracing.Zipkin/pull/68μ—μ„œ μž‘μ—…ν•˜λŠ” λ™μ•ˆ 이 문제λ₯Ό 직접 μž¬ν˜„ν•  수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.

Entity Framework 및 XUnit νŒ€κ³Ό λ™μΌν•œ 결둠에 λ„λ‹¬ν–ˆμŠ΅λ‹ˆλ‹€. 이것은 CLI 자체의 문제이며 ν•΄κ²° 방법은 ν…ŒμŠ€νŠΈ ν”„λ‘œμ νŠΈ λ‚΄μ—μ„œ RuntimeFrameworkVersion μ§€μ •ν•˜λŠ” κ²ƒμœΌλ‘œ λ³΄μž…λ‹ˆλ‹€. 그러면 .NET Core λŸ°νƒ€μž„μ„ μ˜¬λ°”λ₯΄κ²Œ ν•΄κ²°ν•˜λŠ” 데 ν•„μš”ν•œ 정보가 CLI에 μ œκ³΅λ©λ‹ˆλ‹€.

이것이 ν–₯ν›„ κ°œμ„ λ˜κΈ°λ₯Ό λ°”λΌμ§€λ§Œ 이 였λ₯˜λŠ” dotnet-nbench κ°€ 사양을 μ‹€ν–‰ν•˜κΈ° μœ„ν•΄ μƒˆλ‘œμš΄ dotnet ν”„λ‘œμ„ΈμŠ€λ₯Ό μ‹œμž‘ν•œ 후에 λ°œμƒν•©λ‹ˆλ‹€. μ΄λŠ” CLI λ¬Έμ œμž…λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰