Skip to content

Commit 7780042

Browse files
committed
cleanup
1 parent 4841b22 commit 7780042

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

BitFaster.Caching.Benchmarks/Lfu/SketchFrequency.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class SketchFrequency
2626

2727
private CmSketchCore<int, DisableHardwareIntrinsics> blockStd;
2828
private CmSketchNoPin<int, DetectIsa> blockAvxNoPin;
29-
private CmSketchCore<int, DetectIsa> blockVector;
29+
private CmSketchCore<int, DetectIsa> blockAvx;
3030

3131
[Params(32_768, 524_288, 8_388_608, 134_217_728)]
3232
public int Size { get; set; }
@@ -39,7 +39,7 @@ public void Setup()
3939

4040
blockStd = new CmSketchCore<int, DisableHardwareIntrinsics>(Size, EqualityComparer<int>.Default);
4141
blockAvxNoPin = new CmSketchNoPin<int, DetectIsa>(Size, EqualityComparer<int>.Default);
42-
blockVector = new CmSketchCore<int, DetectIsa>(Size, EqualityComparer<int>.Default);
42+
blockAvx = new CmSketchCore<int, DetectIsa>(Size, EqualityComparer<int>.Default);
4343
}
4444

4545
[Benchmark(Baseline = true, OperationsPerInvoke = iterations)]
@@ -81,7 +81,7 @@ public int FrequencyBlockAvxNotPinned()
8181
{
8282
int count = 0;
8383
for (int i = 0; i < iterations; i++)
84-
count += blockAvxNoPin.EstimateFrequency(i) > blockVector.EstimateFrequency(i + 1) ? 1 : 0;
84+
count += blockAvxNoPin.EstimateFrequency(i) > blockAvx.EstimateFrequency(i + 1) ? 1 : 0;
8585

8686
return count;
8787
}
@@ -96,7 +96,7 @@ public int FrequencyBlockAvxPinned()
9696
{
9797
int count = 0;
9898
for (int i = 0; i < iterations; i++)
99-
count += blockVector.EstimateFrequency(i) > blockVector.EstimateFrequency(i + 1) ? 1 : 0;
99+
count += blockAvx.EstimateFrequency(i) > blockAvx.EstimateFrequency(i + 1) ? 1 : 0;
100100

101101
return count;
102102
}

BitFaster.Caching/Lfu/CmSketchCore.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@ public unsafe class CmSketchCore<T, I>
3838
private const long OneMask = 0x1111111111111111L;
3939

4040
private long[] table;
41-
private int sampleSize;
42-
private int blockMask;
43-
private int size;
44-
4541
#if NET6_0_OR_GREATER
4642
private long* tableAddr;
4743
#endif
44+
private int sampleSize;
45+
private int blockMask;
46+
private int size;
4847

4948
private readonly IEqualityComparer<T> comparer;
5049

0 commit comments

Comments
 (0)