@@ -114,34 +114,34 @@ def run_stateless_benchmarks(
114114 print ("\n === Stateless Hash Benchmarks ===" )
115115
116116 # Python built-in hash
117- if should_run ("hash" , filter_pattern ):
118- bench_hash_function ("hash" , tokens , lambda x : hash (x ), time_limit_seconds )
117+ if should_run ("stateless/std. hash() " , filter_pattern ):
118+ bench_hash_function ("std. hash() " , tokens , lambda x : hash (x ), time_limit_seconds )
119119
120120 # xxHash
121- if should_run ("xxhash.xxh3_64" , filter_pattern ):
122- bench_hash_function ("xxhash.xxh3_64" , tokens , lambda x : xxhash .xxh3_64 (x ).intdigest (), time_limit_seconds )
121+ if should_run ("stateless/ xxhash.xxh3_64() " , filter_pattern ):
122+ bench_hash_function ("xxhash.xxh3_64() " , tokens , lambda x : xxhash .xxh3_64 (x ).intdigest (), time_limit_seconds )
123123
124124 # StringZilla hashes
125- if should_run ("stringzilla.hash" , filter_pattern ):
126- bench_hash_function ("stringzilla.hash" , tokens , lambda x : sz .hash (x ), time_limit_seconds )
125+ if should_run ("stateless/ stringzilla.hash() " , filter_pattern ):
126+ bench_hash_function ("stringzilla.hash() " , tokens , lambda x : sz .hash (x ), time_limit_seconds )
127127
128128 # Google CRC32C (Castagnoli) one-shot
129- if should_run ("google_crc32c.value" , filter_pattern ):
130- bench_hash_function ("google_crc32c.value" , tokens , lambda x : google_crc32c .value (x ), time_limit_seconds )
129+ if should_run ("stateless/ google_crc32c.value() " , filter_pattern ):
130+ bench_hash_function ("google_crc32c.value() " , tokens , lambda x : google_crc32c .value (x ), time_limit_seconds )
131131
132132 # MurmurHash3 — stateless
133- if should_run ("mmh3.hash32" , filter_pattern ):
134- bench_hash_function ("mmh3.hash32" , tokens , lambda x : mmh3 .hash (x , signed = False ), time_limit_seconds )
135- if should_run ("mmh3.hash64" , filter_pattern ):
136- bench_hash_function ("mmh3.hash64" , tokens , lambda x : mmh3 .hash64 (x , signed = False )[0 ], time_limit_seconds )
137- if should_run ("mmh3.hash128" , filter_pattern ):
138- bench_hash_function ("mmh3.hash128" , tokens , lambda x : mmh3 .hash128 (x , signed = False ), time_limit_seconds )
133+ if should_run ("stateless/ mmh3.hash32() " , filter_pattern ):
134+ bench_hash_function ("mmh3.hash32() " , tokens , lambda x : mmh3 .hash (x , signed = False ), time_limit_seconds )
135+ if should_run ("stateless/ mmh3.hash64() " , filter_pattern ):
136+ bench_hash_function ("mmh3.hash64() " , tokens , lambda x : mmh3 .hash64 (x , signed = False )[0 ], time_limit_seconds )
137+ if should_run ("stateless/ mmh3.hash128() " , filter_pattern ):
138+ bench_hash_function ("mmh3.hash128() " , tokens , lambda x : mmh3 .hash128 (x , signed = False ), time_limit_seconds )
139139
140140 # CityHash — stateless
141- if should_run ("cityhash.CityHash64" , filter_pattern ):
142- bench_hash_function ("cityhash.CityHash64" , tokens , lambda x : cityhash .CityHash64 (x ), time_limit_seconds )
143- if should_run ("cityhash.CityHash128" , filter_pattern ):
144- bench_hash_function ("cityhash.CityHash128" , tokens , lambda x : cityhash .CityHash128 (x ), time_limit_seconds )
141+ if should_run ("stateless/ cityhash.CityHash64() " , filter_pattern ):
142+ bench_hash_function ("cityhash.CityHash64() " , tokens , lambda x : cityhash .CityHash64 (x ), time_limit_seconds )
143+ if should_run ("stateless/ cityhash.CityHash128() " , filter_pattern ):
144+ bench_hash_function ("cityhash.CityHash128() " , tokens , lambda x : cityhash .CityHash128 (x ), time_limit_seconds )
145145
146146
147147def bench_stateful_hash (
@@ -189,16 +189,16 @@ def run_stateful_benchmarks(
189189 print ("\n === Stateful Hash Benchmarks ===" )
190190
191191 # xxHash stateful
192- if should_run ("xxhash.xxh3_64" , filter_pattern ):
193- bench_stateful_hash ("xxhash.xxh3_64" , tokens , lambda : xxhash .xxh3_64 (), time_limit_seconds )
192+ if should_run ("stateful/ xxhash.xxh3_64() " , filter_pattern ):
193+ bench_stateful_hash ("xxhash.xxh3_64() " , tokens , lambda : xxhash .xxh3_64 (), time_limit_seconds )
194194
195195 # StringZilla stateful hasher
196- if should_run ("stringzilla.Hasher" , filter_pattern ):
197- bench_stateful_hash ("stringzilla.Hasher" , tokens , lambda : sz .Hasher (), time_limit_seconds )
196+ if should_run ("stateful/ stringzilla.Hasher() " , filter_pattern ):
197+ bench_stateful_hash ("stringzilla.Hasher() " , tokens , lambda : sz .Hasher (), time_limit_seconds )
198198
199199 # Google CRC32C (Castagnoli) stateful
200- if should_run ("google_crc32c.Checksum" , filter_pattern ):
201- bench_stateful_hash ("google_crc32c.Checksum" , tokens , lambda : google_crc32c .Checksum (), time_limit_seconds )
200+ if should_run ("stateful/ google_crc32c.Checksum() " , filter_pattern ):
201+ bench_stateful_hash ("google_crc32c.Checksum() " , tokens , lambda : google_crc32c .Checksum (), time_limit_seconds )
202202
203203
204204def run_checksum_benchmarks (
@@ -210,20 +210,20 @@ def run_checksum_benchmarks(
210210 print ("\n === Checksum Hash Benchmarks ===" )
211211
212212 # StringZilla bytesum - reference lower bound
213- if should_run ("stringzilla.bytesum" , filter_pattern ):
214- bench_hash_function ("stringzilla.bytesum" , tokens , lambda x : sz .bytesum (x ), time_limit_seconds )
213+ if should_run ("checksum/ stringzilla.bytesum() " , filter_pattern ):
214+ bench_hash_function ("stringzilla.bytesum() " , tokens , lambda x : sz .bytesum (x ), time_limit_seconds )
215215
216216 # Blake3 - cryptographic hash
217- if should_run ("blake3.digest " , filter_pattern ):
218- bench_hash_function ("blake3.digest " , tokens , lambda x : blake3 .blake3 (x ).digest (), time_limit_seconds )
217+ if should_run ("checksum/ blake3.blake3() " , filter_pattern ):
218+ bench_hash_function ("blake3.blake3() " , tokens , lambda x : blake3 .blake3 (x ).digest (), time_limit_seconds )
219219
220220 # SHA256 via hashlib (Python standard library)
221- if should_run ("hashlib.sha256" , filter_pattern ):
222- bench_hash_function ("hashlib.sha256" , tokens , lambda x : hashlib .sha256 (x ).digest (), time_limit_seconds )
221+ if should_run ("checksum/ hashlib.sha256() " , filter_pattern ):
222+ bench_hash_function ("hashlib.sha256() " , tokens , lambda x : hashlib .sha256 (x ).digest (), time_limit_seconds )
223223
224224 # SHA256 via StringZilla
225- if should_run ("stringzilla.Sha256" , filter_pattern ):
226- bench_hash_function ("stringzilla.Sha256" , tokens , lambda x : sz .Sha256 ().update (x ).digest (), time_limit_seconds )
225+ if should_run ("checksum/ stringzilla.Sha256() " , filter_pattern ):
226+ bench_hash_function ("stringzilla.Sha256() " , tokens , lambda x : sz .Sha256 ().update (x ).digest (), time_limit_seconds )
227227
228228
229229_main_epilog = """
0 commit comments