Skip to content

Commit

Permalink
Upgrade to net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyrest committed Aug 14, 2024
1 parent 7ee02fa commit 5a403ad
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net48</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461;net48</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
Expand All @@ -24,7 +24,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 8 additions & 13 deletions src/FastGenericNew.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
// See https://aka.ms/new-console-template for more information
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.ConsoleArguments.ListBenchmarks;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Environments;

using FastGenericNew;
using FastGenericNew.Benchmarks;
using FastGenericNew.Benchmarks.Units;

ManualConfig config = ManualConfig.Create(DefaultConfig.Instance);
config.AddJob(
//Job.Default.WithRuntime(ClrRuntime.Net48),
//Job.Default.WithRuntime(CoreRuntime.Core50),
Job.Default.WithRuntime(CoreRuntime.Core60));
Job.Default.WithRuntime(ClrRuntime.Net461),
Job.Default.WithRuntime(ClrRuntime.Net48),
Job.Default.WithRuntime(CoreRuntime.Core31),
Job.Default.WithRuntime(CoreRuntime.Core60),
Job.Default.WithRuntime(CoreRuntime.Core80),
Job.Default.WithRuntime(CoreRuntime.Core90)
);

config.AddDiagnoser(MemoryDiagnoser.Default);

//BenchmarkRunner.Run(Assembly.GetCallingAssembly(), config);
#if NET6_0_OR_GREATER
BenchmarkRunner.Run<ImplementationsBenchmark>(config);

#endif
BenchmarkRunner.Run(Assembly.GetCallingAssembly(), config);
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
namespace FastGenericNew.Benchmarks.Units;

#if NET6_0_OR_GREATER && FastNew_AllowUnsafeImplementation
public class ImplementationsBenchmark
{
#if NET6_0_OR_GREATER
[Benchmark]
public DemoClass ClrNew()
{
return ClrAllocator<DemoClass>.CreateInstance();
}
#endif

[Benchmark]
public DemoClass FastNew()
Expand All @@ -22,3 +21,4 @@ public DemoClass Activator()
return System.Activator.CreateInstance<DemoClass>();
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace FastGenericNew.Benchmarks.Units;

#if NET6_0_OR_GREATER
#if NET6_0_OR_GREATER && FastNew_AllowUnsafeImplementation
public unsafe class ImplementationsInitBenchmark
{
public static readonly delegate* managed<void> clrNew = typeof(ClrAllocator<DemoClass>).GetStaticCtor();
Expand Down
8 changes: 4 additions & 4 deletions src/FastGenericNew/FastGenericNew.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<!-- Library Properties -->
<PropertyGroup>
<TargetFrameworks>net6.0;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461;net48</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<ImplicitUsings>disabled</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>_generated</CompilerGeneratedFilesOutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -45,7 +45,7 @@
</ItemGroup>
<!-- Dependencies for .NET Standard 2.0 -->
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
</ItemGroup>

<!-- Reference to Source Generator-->
Expand Down

0 comments on commit 5a403ad

Please sign in to comment.