Skip to content

Commit

Permalink
interesting todos for #57
Browse files Browse the repository at this point in the history
  • Loading branch information
dadhi committed Aug 10, 2023
1 parent eed5e6c commit 35fe81a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ImTools/ImTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6926,6 +6926,8 @@ public class DebugProxy<K, V, TEq, TEntries>
// todo: @improve ? how/where to add SIMD to improve CPU utilization but not losing perf for smaller sizes
// todo: @perf We may use Stack-on-stack data structure similar to FastExrpressionCompiler.Stack4 for packed hashes up to 4 or more.
// todo: @perf In case of using RefEq it might be faster for the small map to lookup by comparing entry key instead of reaching for hash
// todo: @perf We may additionally implement the Enumerator for the Entries or just expose the array for the SingleArrayEntries to allow fastest iteration without checks for Removed! entries (if you have knowledge the nothing is removed ever).
// todo: @perf ...related to the Enumerator above, another option is to expose GetIncludingRemovedEntriesEnumerator() on the map itself

/// <summary>
/// Fast and less-allocating hash map without thread safety nets. Please measure it in your own use case before use.
Expand Down
2 changes: 1 addition & 1 deletion test/ImTools.UnitTests/FHashMapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public static void VerifyNoDuplicateKeys<K, V, TEq, TEntries>(this FHashMap<K, V
if (h == 0)
continue;
var key = map.Entries.GetSurePresentEntryRef(h & indexMask).Key;
if (!uniq.TryGetValue(key, out _))
if (!uniq.ContainsKey(key))
uniq.Add(key, 1);
else
Assert.Fail($"Duplicate key: {key}");
Expand Down

0 comments on commit 35fe81a

Please sign in to comment.