diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 89aae1c..a52c70f 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -16,37 +16,37 @@ jobs: build: strategy: matrix: - os: - - windows-latest - - ubuntu-latest - - macos-13 - targetFramework: - - net8.0 - - net7.0 - - net6.0 - - net5.0 - - netcoreapp3.1 - platform: - - x64 include: - - os: windows-latest - targetFramework: net48 - platform: x64 - - os: windows-latest - targetFramework: net48 - platform: x86 - - os: windows-latest - targetFramework: net7.0 - platform: x86 - - os: windows-latest - targetFramework: net6.0 - platform: x86 - - os: windows-latest - targetFramework: net5.0 - platform: x86 - - os: windows-latest - targetFramework: netcoreapp3.1 - platform: x86 + # .NET 8.0 Tests + - { os: windows-latest, targetFramework: net8.0, platform: x64 } + - { os: ubuntu-latest, targetFramework: net8.0, platform: x64 } + - { os: macos-15-intel, targetFramework: net8.0, platform: x64 } + + # .NET 7.0 Tests + - { os: windows-latest, targetFramework: net7.0, platform: x64 } + - { os: ubuntu-latest, targetFramework: net7.0, platform: x64 } + - { os: macos-15-intel, targetFramework: net7.0, platform: x64 } + - { os: windows-latest, targetFramework: net7.0, platform: x86 } + + # .NET 6.0 Tests + - { os: windows-latest, targetFramework: net6.0, platform: x64 } + - { os: ubuntu-latest, targetFramework: net6.0, platform: x64 } + - { os: macos-15-intel, targetFramework: net6.0, platform: x64 } + - { os: windows-latest, targetFramework: net6.0, platform: x86 } + + # .NET 5.0 Tests (no Ubuntu, libSSL issues) + - { os: windows-latest, targetFramework: net5.0, platform: x64 } + - { os: macos-15-intel, targetFramework: net5.0, platform: x64 } + - { os: windows-latest, targetFramework: net5.0, platform: x86 } + + # .NET Core 3.1 Tests (no Ubuntu, libSSL issues) + - { os: windows-latest, targetFramework: netcoreapp3.1, platform: x64 } + - { os: macos-15-intel, targetFramework: netcoreapp3.1, platform: x64 } + - { os: windows-latest, targetFramework: netcoreapp3.1, platform: x86 } + + # .NET Framework 4.8 Tests (Windows only) + - { os: windows-latest, targetFramework: net48, platform: x64 } + - { os: windows-latest, targetFramework: net48, platform: x86 } runs-on: ${{ matrix.os }} steps: diff --git a/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHash.cs b/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHash.cs index fdb10ce..edbf906 100644 --- a/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHash.cs +++ b/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHash.cs @@ -26,7 +26,11 @@ internal static class UnstableStringHash /// [ExcludeFromCodeCoverage] // "Cannot be accurately measured without multiple architectures. Known good impl." This is still tested tho. [SuppressMessage("ReSharper", "InconsistentNaming")] +#if NET5_0_OR_GREATER + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] +#else [MethodImpl(MethodImplOptions.AggressiveInlining)] +#endif internal static unsafe nuint GetHashCodeUnstable(this ReadOnlySpan text) { #if NET7_0_OR_GREATER @@ -51,9 +55,7 @@ internal static unsafe nuint GetHashCodeUnstable(this ReadOnlySpan text) } #if NET7_0_OR_GREATER -#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64 [MethodImpl(MethodImplOptions.AggressiveOptimization)] -#endif internal static unsafe UIntPtr UnstableHashVec128(this ReadOnlySpan text) { fixed (char* src = &text.GetPinnableReference()) @@ -118,9 +120,7 @@ internal static unsafe UIntPtr UnstableHashVec128(this ReadOnlySpan text) } } -#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64 [MethodImpl(MethodImplOptions.AggressiveOptimization)] -#endif internal static unsafe UIntPtr UnstableHashVec256(this ReadOnlySpan text) { fixed (char* src = &text.GetPinnableReference()) diff --git a/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHashLower.cs b/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHashLower.cs index 2809629..27ed825 100644 --- a/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHashLower.cs +++ b/src/Reloaded.Memory/Internals/Algorithms/UnstableStringHashLower.cs @@ -30,7 +30,11 @@ internal static class UnstableStringHashLower /// [ExcludeFromCodeCoverage] // "Cannot be accurately measured without multiple architectures. Known good impl." This is still tested tho. [SuppressMessage("ReSharper", "InconsistentNaming")] +#if NET5_0_OR_GREATER + [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] +#else [MethodImpl(MethodImplOptions.AggressiveInlining)] +#endif internal static unsafe nuint GetHashCodeUnstableLower(this ReadOnlySpan text) { #if NET7_0_OR_GREATER @@ -99,9 +103,7 @@ internal static unsafe nuint GetHashCodeUnstableLowerSlow(this ReadOnlySpan text) { fixed (char* src = &text.GetPinnableReference()) @@ -222,9 +224,7 @@ internal static unsafe UIntPtr UnstableHashVec128Lower(this ReadOnlySpan t return GetHashCodeUnstableLowerSlow(text); } -#if NET8_0 // Bug in .NET 8 seems to cause this to not re-jit to tier1 till like 200k calls on Linux x64 [MethodImpl(MethodImplOptions.AggressiveOptimization)] -#endif internal static unsafe UIntPtr UnstableHashVec256Lower(this ReadOnlySpan text) { fixed (char* src = &text.GetPinnableReference())