import times, random, strutils include bloom type DataPattern = enum dpRandom, # Random strings dpSequential, # Sequential numbers dpFixed, # Fixed length strings dpLong, # Long strings dpSpecial # Strings with special characters type BenchmarkResult = tuple[ insertTime: float, lookupTime: float, falsePositives: int ] proc generateBenchData(pattern: DataPattern, size: int, isLookupData: bool = false): seq[string] = result = newSeq[string](size) let offset = if isLookupData: size * 2 else: 0 # Ensure lookup data is well separated case pattern: of dpRandom: for i in 0..