@@ -283,7 +283,7 @@ private static string GenerateNumericInternal<TKey, TValue>(ReadOnlyMemory<TKey>
283283
284284 LogStructureType ( logger , structureType . Name ) ;
285285
286- IStructure < TKey , TValue , IContext > structure = NumericStructureFactory < TKey , TValue > ( structureType , props , cacheHashData ! , sorted ) ;
286+ IStructure < TKey , TValue , IContext > structure = NumericStructureFactory < TKey , TValue > ( cfg , structureType , props , cacheHashData ! , sorted ) ;
287287
288288 IEarlyExit [ ] earlyExits = CombineEarlyExits ( structure . GetMandatoryExits ( ) , NumericEarlyExits < TKey > . GetCandidates ( type , props . MinKeyValue , props . MaxKeyValue , props . Range , props . BitMask , ( uint ) keys . Length , cfg . EarlyExitConfig ) ) ;
289289
@@ -321,7 +321,7 @@ private static IEarlyExit[] CombineEarlyExits(IEnumerable<IEarlyExit> mandatoryE
321321 return combined . ToArray ( ) ;
322322 }
323323
324- private static IStructure < TKey , TValue , IContext > NumericStructureFactory < TKey , TValue > ( Type type , NumericKeyProperties < TKey > props , HashData hashData , bool sorted )
324+ private static IStructure < TKey , TValue , IContext > NumericStructureFactory < TKey , TValue > ( DataConfig cfg , Type type , NumericKeyProperties < TKey > props , HashData hashData , bool sorted )
325325 {
326326 if ( type == typeof ( ArrayStructure < , > ) )
327327 return new ArrayStructure < TKey , TValue > ( ) ;
@@ -336,7 +336,7 @@ private static IStructure<TKey, TValue, IContext> NumericStructureFactory<TKey,
336336 if ( type == typeof ( ConditionalStructure < , > ) )
337337 return new ConditionalStructure < TKey , TValue > ( ) ;
338338 if ( type == typeof ( EliasFanoStructure < , > ) )
339- return new EliasFanoStructure < TKey , TValue > ( props . MinKeyValue , props . MaxKeyValue , props . ValueConverter , sorted , 128 ) ; // TODO: Make skip a config
339+ return new EliasFanoStructure < TKey , TValue > ( props . MinKeyValue , props . MaxKeyValue , props . ValueConverter , sorted , GetSetting ( cfg , "SkipQuantum" , 128 ) ) ;
340340 if ( type == typeof ( HashTableStructure < , > ) )
341341 return new HashTableStructure < TKey , TValue > ( hashData ) ;
342342 if ( type == typeof ( HashTableCompactStructure < , > ) )
@@ -353,6 +353,14 @@ private static IStructure<TKey, TValue, IContext> NumericStructureFactory<TKey,
353353 throw new InvalidOperationException ( $ "Unsupported DataStructure { type } ") ;
354354 }
355355
356+ private static T GetSetting < T > ( DataConfig cfg , string key , T defaultValue )
357+ {
358+ if ( ! cfg . StructureSettings . TryGetValue ( key , out object ? value ) )
359+ return defaultValue ;
360+
361+ return ( T ) value ;
362+ }
363+
356364 private sealed class UsedFunctionVisitor : ExpressionVisitor
357365 {
358366 internal StringFunction Functions { get ; private set ; }
0 commit comments