-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use ldtoken + castclass instead of ldtoken + isinst in TsavoriteEqualityComparer.Get * JIT is more "used" to former pattern. * Cache key comparers in Tsavorite * Cache stateless comparers in Garnet * i.e.ByteArrayComparer and SortedSetComparer
- Loading branch information
1 parent
1827878
commit 918775d
Showing
11 changed files
with
99 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ITsavoriteEqualityComparer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace Tsavorite.core | ||
{ | ||
/// <summary> | ||
/// Key interface | ||
/// Defines methods to support the comparison of Tsavorite keys for equality. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <typeparam name="T">The type of keys to compare.</typeparam> | ||
/// <remarks>This comparer differs from the built-in <see cref="IEqualityComparer{T}"/> in that it implements a 64-bit hash code</remarks> | ||
public interface ITsavoriteEqualityComparer<T> | ||
{ | ||
/// <summary> | ||
/// Get 64-bit hash code | ||
/// </summary> | ||
/// <returns></returns> | ||
long GetHashCode64(ref T k); | ||
long GetHashCode64(ref T key); | ||
|
||
/// <summary> | ||
/// Equality comparison | ||
/// </summary> | ||
/// <param name="k1">Left side</param> | ||
/// <param name="k2">Right side</param> | ||
/// <returns></returns> | ||
bool Equals(ref T k1, ref T k2); | ||
} | ||
} |
Oops, something went wrong.