Skip to content

Commit

Permalink
Added platform check to disable net48 runs on Ubuntu runners
Browse files Browse the repository at this point in the history
  • Loading branch information
csrakowski committed Nov 19, 2023
1 parent bc24099 commit 6e6cab5
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 24 deletions.
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<DefineConstants>OS_WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))">
<DefineConstants>OS_LINUX</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace CSRakowski.Parallel.Benchmarks
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class CompareWith_Parallel_ForEachAsync
{
private const int NumberOfItemsInCollection = 10000;
Expand Down
11 changes: 7 additions & 4 deletions tests/CSRakowski.Parallel.Benchmarks/Benchmarks/Computations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ namespace CSRakowski.Parallel.Benchmarks
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
//[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
//[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: true)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class Computations
{
private const int NumberOfItemsInCollection = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ namespace CSRakowski.Parallel.Benchmarks
{
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory, BenchmarkLogicalGroupRule.ByParams)]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class FuncOverloading
{
private const int NumberOfItemsInCollection = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ namespace CSRakowski.Parallel.Benchmarks
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class ParallelAsyncBenchmarks
{
private const int NumberOfItemsInCollection = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ namespace CSRakowski.Parallel.Benchmarks
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class ParallelAsyncBenchmarks_AsyncStreams
{
private const int NumberOfItemsInCollection = 10000;
Expand Down Expand Up @@ -62,18 +65,18 @@ public async Task<int> IEnumerable_ForEachAsyncStream()
{
int count = 0;

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER

await foreach (var r in ParallelAsync.ForEachAsyncStream(InputNumbers, TestFunctions.JustAddOne_WithCancellationToken, MaxBatchSize, AllowOutOfOrder, NumberOfItemsInCollection, CancellationToken.None))
{
count++;
}

#else
#else

await Task.CompletedTask;

#endif //NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER
#endif //NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER

return count;
}
Expand All @@ -83,18 +86,18 @@ public async Task<int> IAsyncEnumerable_ForEachAsyncStream()
{
int count = 0;

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER

await foreach (var r in ParallelAsync.ForEachAsyncStream(InputNumbersAsync, TestFunctions.JustAddOne_WithCancellationToken, MaxBatchSize, AllowOutOfOrder, NumberOfItemsInCollection, CancellationToken.None))
{
count++;
}

#else
#else

await Task.CompletedTask;

#endif //NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER
#endif //NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER

return count;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ namespace CSRakowski.Parallel.Benchmarks
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class ParallelAsyncBenchmarks_IAsyncEnumerable
{
private const int NumberOfItemsInCollection = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ namespace CSRakowski.Parallel.Benchmarks
{
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByMethod, BenchmarkLogicalGroupRule.ByParams)]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class ParallelAsyncTestBenchmarks
{
private const int NumberOfItemsInCollection = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ namespace CSRakowski.Parallel.Benchmarks
{
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class UsingForEachForOrdered
{
private const int NumberOfItemsInCollection = 100000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ namespace CSRakowski.Parallel.Benchmarks
{
[MemoryDiagnoser]
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[SimpleJob(RuntimeMoniker.Net48, baseline: true)]
#if OS_WINDOWS
[SimpleJob(RuntimeMoniker.Net48, baseline: false)]
#endif
[SimpleJob(RuntimeMoniker.NetCoreApp31, baseline: false)]
[SimpleJob(RuntimeMoniker.Net50, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: false)]
[SimpleJob(RuntimeMoniker.Net60, baseline: true)]
[SimpleJob(RuntimeMoniker.Net80, baseline: false)]
public class UsingForEachForUnbatched
{
private const int NumberOfItemsInCollection = 1000000;
Expand Down

0 comments on commit 6e6cab5

Please sign in to comment.