swiss ok, needs more benchmark

This commit is contained in:
Youmu Liu
2026-03-06 18:22:30 +08:00
parent 83997f64d0
commit f6e897ed06
70 changed files with 1889 additions and 3371 deletions
+17 -5
View File
@@ -2,8 +2,8 @@
// -----------------------------------------------------------------------
// file="UnsafeCompute"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
// AuthorGroup: Nitload
// Copyright (c) Nitload. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -25,6 +25,7 @@
//
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
using StgSharp.Mathematics.Numeric;
using System.Runtime.CompilerServices;
namespace StgSharp.Mathematics.Internal
@@ -33,19 +34,30 @@ namespace StgSharp.Mathematics.Internal
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int CityHashSimplify(char* span, int length)
public static unsafe int CityHashSimplify(
char* span,
int length
)
{
return NumericalModule.GlobalContext.city_hash_simplify(span, length);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int CityHashSimplify(char* span, int begin, int length)
public static unsafe int CityHashSimplify(
char* span,
int begin,
int length
)
{
return NumericalModule.GlobalContext.city_hash_simplify(span + begin, length);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe int IndexOfCharPair(char* source, int pairValue, int length)
public static unsafe int IndexOfCharPair(
char* source,
int pairValue,
int length
)
{
return NumericalModule.GlobalContext.index_pair(source, pairValue, length);
}