Commit dc585e1b authored by Geoff Simmons's avatar Geoff Simmons

The benchmark for PH prints expected collisions and collision rate.

parent 7d6d570e
......@@ -322,6 +322,10 @@ main(int argc, char *argv[])
printf("Stats computed in %lu ns\n", tdiff(&before, &after));
printf("%lu buckets\n", stats.buckets);
printf("%lu collisions\n", stats.collisions);
printf("%lu expected collisions\n",
((uint64_t)n * (uint64_t)(n - 1)) / (stats.buckets * 2));
printf("%.3f collision rate\n",
(double)stats.collisions / (double)stats.buckets);
printf("%lu key vector length\n", stats.klen);
printf("%lu min string length\n", stats.minlen);
printf("%lu max string length\n", stats.maxlen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment