88namespace BitFaster . Caching . Benchmarks . Lfu
99{
1010 [ SimpleJob ( RuntimeMoniker . Net60 ) ]
11+ [ SimpleJob ( RuntimeMoniker . Net80 ) ]
12+ [ SimpleJob ( RuntimeMoniker . Net90 ) ]
1113 [ MemoryDiagnoser ( displayGenColumns : false ) ]
1214 [ HideColumns ( "Job" , "Median" , "RatioSD" , "Alloc Ratio" ) ]
1315 [ ColumnChart ( Title = "Sketch Frequency ({JOB})" ) ]
@@ -20,6 +22,7 @@ public class SketchFrequency
2022 private CmSketchFlat < int , DetectIsa > flatAvx ;
2123
2224 private CmSketchCore < int , DisableHardwareIntrinsics > blockStd ;
25+ private CmSketchNoPin < int , DetectIsa > blockAvxNoPin ;
2326 private CmSketchCore < int , DetectIsa > blockAvx ;
2427
2528 [ Params ( 32_768 , 524_288 , 8_388_608 , 134_217_728 ) ]
@@ -32,6 +35,7 @@ public void Setup()
3235 flatAvx = new CmSketchFlat < int , DetectIsa > ( Size , EqualityComparer < int > . Default ) ;
3336
3437 blockStd = new CmSketchCore < int , DisableHardwareIntrinsics > ( Size , EqualityComparer < int > . Default ) ;
38+ blockAvxNoPin = new CmSketchNoPin < int , DetectIsa > ( Size , EqualityComparer < int > . Default ) ;
3539 blockAvx = new CmSketchCore < int , DetectIsa > ( Size , EqualityComparer < int > . Default ) ;
3640 }
3741
@@ -45,7 +49,7 @@ public int FrequencyFlat()
4549 return count ;
4650 }
4751
48- [ Benchmark ( OperationsPerInvoke = iterations ) ]
52+ // [Benchmark(OperationsPerInvoke = iterations)]
4953 public int FrequencyFlatAvx ( )
5054 {
5155 int count = 0 ;
@@ -66,7 +70,17 @@ public int FrequencyBlock()
6670 }
6771
6872 [ Benchmark ( OperationsPerInvoke = iterations ) ]
69- public int FrequencyBlockAvx ( )
73+ public int FrequencyBlockAvxNotPinned ( )
74+ {
75+ int count = 0 ;
76+ for ( int i = 0 ; i < iterations ; i ++ )
77+ count += blockAvxNoPin . EstimateFrequency ( i ) > blockAvx . EstimateFrequency ( i + 1 ) ? 1 : 0 ;
78+
79+ return count ;
80+ }
81+
82+ [ Benchmark ( OperationsPerInvoke = iterations ) ]
83+ public int FrequencyBlockAvxPinned ( )
7084 {
7185 int count = 0 ;
7286 for ( int i = 0 ; i < iterations ; i ++ )
0 commit comments