-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cleanup BDN organization
- Loading branch information
Showing
30 changed files
with
613 additions
and
907 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
namespace BDN.benchmark.Cluster | ||
{ | ||
/// <summary> | ||
/// Cluster parameters | ||
/// </summary> | ||
public struct ClusterParams | ||
{ | ||
/// <summary> | ||
/// Whether to disable slot verification | ||
/// </summary> | ||
public bool disableSlotVerification; | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
public ClusterParams(bool disableSlotVerification) | ||
{ | ||
this.disableSlotVerification = disableSlotVerification; | ||
} | ||
|
||
/// <summary> | ||
/// String representation | ||
/// </summary> | ||
public override string ToString() | ||
{ | ||
if (!disableSlotVerification) | ||
return "None"; | ||
|
||
var ret = ""; | ||
if (disableSlotVerification) | ||
ret += "DSV"; | ||
return ret; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace BDN.benchmark.Cluster | ||
{ | ||
/// <summary> | ||
/// Request struct | ||
/// </summary> | ||
unsafe struct Request | ||
{ | ||
public byte[] buffer; | ||
public byte* ptr; | ||
|
||
public Request(int size) | ||
{ | ||
buffer = GC.AllocateArray<byte>(size, pinned: true); | ||
ptr = (byte*)Unsafe.AsPointer(ref buffer[0]); | ||
} | ||
} | ||
|
||
} |
17 changes: 0 additions & 17 deletions
17
benchmark/BDN.benchmark/Cluster/RespClusterDisableSlotVerificationBench.cs
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
|
||
using BenchmarkDotNet.Attributes; | ||
|
||
namespace BDN.benchmark.Geo | ||
{ | ||
/// <summary> | ||
/// Benchmark for GeoHash | ||
/// </summary> | ||
[MemoryDiagnoser] | ||
public class GeoHash | ||
{ | ||
private const double Latitude = 47.642219912251285; | ||
private const double Longitude = -122.14205560231471; | ||
|
||
private const long GeoHashInteger = 1557413161902764; | ||
|
||
[Benchmark] | ||
public long GeoToLongValue() => Garnet.server.GeoHash.GeoToLongValue(Latitude, Longitude); | ||
|
||
[Benchmark] | ||
public (double, double) GetCoordinatesFromLong() => Garnet.server.GeoHash.GetCoordinatesFromLong(GeoHashInteger); | ||
|
||
[Benchmark] | ||
public string GetGeoHashCode() => Garnet.server.GeoHash.GetGeoHashCode(GeoHashInteger); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.