Skip to content

Commit

Permalink
Few workarounds for the next manual perf run (#2282)
Browse files Browse the repository at this point in the history
* define NET7_0_PREVIEW2_OR_GREATER const for .NET 7 Preview2+ builds

* don't use Regex.Count API for older versions of .NET 7 (used as baseline for monthly perf runs)

* don't try to run AddRemoveFromDifferentThreads.ConcurrentStack benchmark on ARM64 as it hangs

details: dotnet/runtime#64980

* don't try to run Json_FromString.Jil_ benchmark on ARM64 as it throws AccessViolationException

details: dotnet/runtime#64657
  • Loading branch information
adamsitnik authored Mar 1, 2022
1 parent 95abb94 commit 96874f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/benchmarks/micro/MicroBenchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<DebugSymbols>true</DebugSymbols>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnableXlfLocalization>false</EnableXlfLocalization>
<DefineConstants Condition=" '$(MSBuildFileVersion)' > '17.2.0.10401' AND $(NETCoreSdkVersion.StartsWith(7.0.100-preview))">$(DefineConstants);NET7_0_PREVIEW2_OR_GREATER</DefineConstants>
</PropertyGroup>
<!-- out-of-band packages that are not included in NetCoreApp have TFM-specific versions -->
<Choose>
Expand Down
3 changes: 3 additions & 0 deletions src/benchmarks/micro/Serializers/Json_FromString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class Json_FromString<T>

[BenchmarkCategory(Categories.ThirdParty)]
[Benchmark(Description = "Jil")]
#if NET7_0 // https://github.com/dotnet/runtime/issues/64657
[OperatingSystemsArchitectureFilter(false, System.Runtime.InteropServices.Architecture.Arm64)]
#endif
public T Jil_() => Jil.JSON.Deserialize<T>(serialized, Jil.Options.ISO8601);

[GlobalSetup(Target = nameof(JsonNet_))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public void SetupConcurrentStackIteration()
}

[Benchmark]
#if NET7_0 // https://github.com/dotnet/runtime/issues/64980
[OperatingSystemsArchitectureFilter(false, System.Runtime.InteropServices.Architecture.Arm64)]
#endif
public void ConcurrentStack() => SignalAndWaitForAllTasks();

[IterationSetup(Target = nameof(ConcurrentQueue))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static string ReadInputFile(string name)

public static int Count(Regex r, string input)
{
#if NET7_0_OR_GREATER
#if NET7_0_PREVIEW2_OR_GREATER
return r.Count(input);
#else
int count = 0;
Expand Down

0 comments on commit 96874f1

Please sign in to comment.