Skip to content

Commit 5a403ad

Browse files
committed
Upgrade to net8.0
1 parent 7ee02fa commit 5a403ad

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

src/FastGenericNew.Benchmarks/FastGenericNew.Benchmarks.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net6.0;net5.0</TargetFrameworks>
6-
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net48</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
6+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461;net48</TargetFrameworks>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
<LangVersion>10</LangVersion>
@@ -24,7 +24,7 @@
2424
</PropertyGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
27+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
2828
</ItemGroup>
2929

3030
<ItemGroup>
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
// See https://aka.ms/new-console-template for more information
22
using BenchmarkDotNet.Configs;
3-
using BenchmarkDotNet.ConsoleArguments.ListBenchmarks;
43
using BenchmarkDotNet.Diagnosers;
54
using BenchmarkDotNet.Environments;
65

7-
using FastGenericNew;
8-
using FastGenericNew.Benchmarks;
9-
using FastGenericNew.Benchmarks.Units;
10-
116
ManualConfig config = ManualConfig.Create(DefaultConfig.Instance);
127
config.AddJob(
13-
//Job.Default.WithRuntime(ClrRuntime.Net48),
14-
//Job.Default.WithRuntime(CoreRuntime.Core50),
15-
Job.Default.WithRuntime(CoreRuntime.Core60));
8+
Job.Default.WithRuntime(ClrRuntime.Net461),
9+
Job.Default.WithRuntime(ClrRuntime.Net48),
10+
Job.Default.WithRuntime(CoreRuntime.Core31),
11+
Job.Default.WithRuntime(CoreRuntime.Core60),
12+
Job.Default.WithRuntime(CoreRuntime.Core80),
13+
Job.Default.WithRuntime(CoreRuntime.Core90)
14+
);
1615

1716
config.AddDiagnoser(MemoryDiagnoser.Default);
1817

19-
//BenchmarkRunner.Run(Assembly.GetCallingAssembly(), config);
20-
#if NET6_0_OR_GREATER
21-
BenchmarkRunner.Run<ImplementationsBenchmark>(config);
22-
23-
#endif
18+
BenchmarkRunner.Run(Assembly.GetCallingAssembly(), config);

src/FastGenericNew.Benchmarks/Units/ImplementationsBenchmark.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
namespace FastGenericNew.Benchmarks.Units;
22

3+
#if NET6_0_OR_GREATER && FastNew_AllowUnsafeImplementation
34
public class ImplementationsBenchmark
45
{
5-
#if NET6_0_OR_GREATER
66
[Benchmark]
77
public DemoClass ClrNew()
88
{
99
return ClrAllocator<DemoClass>.CreateInstance();
1010
}
11-
#endif
1211

1312
[Benchmark]
1413
public DemoClass FastNew()
@@ -22,3 +21,4 @@ public DemoClass Activator()
2221
return System.Activator.CreateInstance<DemoClass>();
2322
}
2423
}
24+
#endif

src/FastGenericNew.Benchmarks/Units/ImplementationsInitBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace FastGenericNew.Benchmarks.Units;
55

6-
#if NET6_0_OR_GREATER
6+
#if NET6_0_OR_GREATER && FastNew_AllowUnsafeImplementation
77
public unsafe class ImplementationsInitBenchmark
88
{
99
public static readonly delegate* managed<void> clrNew = typeof(ClrAllocator<DemoClass>).GetStaticCtor();

src/FastGenericNew/FastGenericNew.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
<!-- Library Properties -->
44
<PropertyGroup>
5-
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
6-
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
5+
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
6+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461;net48</TargetFrameworks>
77
<LangVersion>9.0</LangVersion>
88
<ImplicitUsings>disabled</ImplicitUsings>
99
<Nullable>enable</Nullable>
1010
<IsTrimmable>true</IsTrimmable>
1111
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
1212
<CompilerGeneratedFilesOutputPath>_generated</CompilerGeneratedFilesOutputPath>
1313
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
14-
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
14+
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
1515
</PropertyGroup>
1616

1717
<ItemGroup>
@@ -45,7 +45,7 @@
4545
</ItemGroup>
4646
<!-- Dependencies for .NET Standard 2.0 -->
4747
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
48-
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
48+
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
4949
</ItemGroup>
5050

5151
<!-- Reference to Source Generator-->

0 commit comments

Comments
 (0)