mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-03-07 21:27:55 -05:00
Implement FNV-1 hashing for CCInt.hash as a C stub instead of a pure-OCaml Int64-based loop. The core hash function operates on int64 with separate native/bytecode entry points for both int and int64. - cc_stubs.c: cc_fnv_hash_int64 core, with int and int64 wrappers - Uses [@untagged] for int args, [@unboxed] ready for int64 - OCAML_INT_MASK ensures correct byte extraction for 63-bit ints - Hash values are unchanged from the previous OCaml implementation Also adds a throughput benchmark in benchs/run_benchs.ml comparing the old pure-OCaml FNV hash vs the new C stub (~2x faster).
23 lines
366 B
Text
23 lines
366 B
Text
(executables
|
|
(names run_benchs run_bench_hash run_objsize)
|
|
(libraries
|
|
containers
|
|
containers_pvec
|
|
containers-data
|
|
benchmark
|
|
gen
|
|
iter
|
|
qcheck
|
|
oseq
|
|
batteries
|
|
sek)
|
|
(flags :standard -warn-error -3-5 -w -60 -safe-string -color always)
|
|
(optional)
|
|
(ocamlopt_flags
|
|
:standard
|
|
-O3
|
|
-color
|
|
always
|
|
-unbox-closures
|
|
-unbox-closures-factor
|
|
20))
|