# Xxhash perf \(\#15947\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/559150e8440d288adfaeb84c8bc3ec400605287d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 559150e8440d288adfaeb84c8bc3ec400605287d

Requested commit: 559150e8440d288adfaeb84c8bc3ec400605287d

Commit: 559150e8440d288adfaeb84c8bc3ec400605287d

Tree: cd786a3360a780067c1f12d9ec84beca49f087b7

Author: Dominic

Committer: GitHub

## Message

```
Xxhash perf (#15947)

Improvements for xxHash performance, both on small keys as well as large slices.

* std.hash: make benchmarks consistent for xxhash

There is some odd behaviour in the timings for the XXHash benchmarks
introduced in 879f0b9, specifically the changes to the allocation in
benchmarkHash. The problem is somewhere in the difference between
9628243 and 9362d61 (these are commit that were force-pushed over but
        can be found in PR #15917).

* std.hash: correctly calculate throughput in benchmark
* std.hash: add hashes per sec to small key output
* std.hash: add exact and small xxhash routines
* std.hash: add --small-only flag to benchmark
* std.hash.xxhash: extract stateless Accumulator type
* std.hash.xxhash: cleanup hash() and improve small key perf
* std.hash.xxhash: port xxhash64 changes to xxhash32
* std.hash: change benchmark --small-only flag to --include-array
```

## Parents

- [d82b35901035a325ca7afd38b28ff2386f90ae84](https://git.cafe/gitcafe/zig/commit/d82b35901035a325ca7afd38b28ff2386f90ae84?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/559150e8440d288adfaeb84c8bc3ec400605287d?format=markdown)
