diff --git a/.github/workflows/RunUnityTests.yml b/.github/workflows/RunUnityTests.yml index 8d469bac2..44911ff96 100644 --- a/.github/workflows/RunUnityTests.yml +++ b/.github/workflows/RunUnityTests.yml @@ -14,7 +14,7 @@ jobs: - 2019.4.40f1 - 2020.3.44f1 - 2021.3.18f1 - - 2022.2.5f1 + - 2022.2.6f1 steps: - name: Checkout repository diff --git a/Assets/Mirror/Core/Tools/Extensions.cs b/Assets/Mirror/Core/Tools/Extensions.cs index 345e17b98..28c91e560 100644 --- a/Assets/Mirror/Core/Tools/Extensions.cs +++ b/Assets/Mirror/Core/Tools/Extensions.cs @@ -9,7 +9,11 @@ public static class Extensions public static string ToHexString(this ArraySegment segment) => BitConverter.ToString(segment.Array, segment.Offset, segment.Count); - public static readonly Dictionary StableHashes = new Dictionary(); + // GetStableHashCode is O(N). + // the longer the string, the more it needs to compute: + // https://github.com/MirrorNetworking/Mirror/pull/3377 + // cache results for O(1) lookups. + static readonly Dictionary StableHashes = new Dictionary(); [UnityEngine.RuntimeInitializeOnLoadMethod] public static void ResetStatics()