Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cs/benchmark/FasterSpanByteYcsbBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

#pragma warning disable CS0162 // Unreachable code detected -- when switching on YcsbConstants

// Define below to enable continuous performance report for dashboard
// #define DASHBOARD

Expand Down Expand Up @@ -297,7 +295,7 @@ internal unsafe (double, double) Run(TestLoader testLoader)
long start = swatch.ElapsedTicks;
if (store.TakeHybridLogCheckpoint(out _, testLoader.Options.PeriodicCheckpointType, testLoader.Options.PeriodicCheckpointTryIncremental))
{
store.CompleteCheckpointAsync().GetAwaiter().GetResult();
store.CompleteCheckpointAsync().AsTask().GetAwaiter().GetResult();
var timeTaken = (swatch.ElapsedTicks - start) / TimeSpan.TicksPerMillisecond;
Console.WriteLine("Checkpoint time: {0}ms", timeTaken);
checkpointTaken++;
Expand Down
4 changes: 1 addition & 3 deletions cs/benchmark/FasterYcsbBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

#pragma warning disable CS0162 // Unreachable code detected -- when switching on YcsbConstants

// Define below to enable continuous performance report for dashboard
// #define DASHBOARD

Expand Down Expand Up @@ -292,7 +290,7 @@ internal unsafe (double, double) Run(TestLoader testLoader)
long start = swatch.ElapsedTicks;
if (store.TakeHybridLogCheckpoint(out _, testLoader.Options.PeriodicCheckpointType, testLoader.Options.PeriodicCheckpointTryIncremental))
{
store.CompleteCheckpointAsync().GetAwaiter().GetResult();
store.CompleteCheckpointAsync().AsTask().GetAwaiter().GetResult();
var timeTaken = (swatch.ElapsedTicks - start) / TimeSpan.TicksPerMillisecond;
Console.WriteLine("Checkpoint time: {0}ms", timeTaken);
checkpointTaken++;
Expand Down
10 changes: 8 additions & 2 deletions cs/benchmark/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ public void CopyUpdater(ref Key key, ref Input input, ref Value oldValue, ref Va

public void Lock(ref RecordInfo recordInfo, ref Key key, ref Value value, LockType lockType, ref long lockContext)
{
recordInfo.SpinLock();
if (lockType == LockType.Exclusive)
recordInfo.LockExclusive();
else
recordInfo.LockShared();
}

public bool Unlock(ref RecordInfo recordInfo, ref Key key, ref Value value, LockType lockType, long lockContext)
{
recordInfo.Unlock();
if (lockType == LockType.Exclusive)
recordInfo.UnlockExclusive();
else
recordInfo.UnlockShared();
return true;
}
}
Expand Down
Loading