# Improve siphash performance for small keys by up to 30% \(\#3124\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 326b7b794b01a1194df3785e497460bada756c29

Requested commit: 326b7b794b01a1194df3785e497460bada756c29

Commit: 326b7b794b01a1194df3785e497460bada756c29

Tree: 9fa2594364a239b0981f6b16ce0ed095fb0f9cf7

Author: Marc Tiehuis

Committer: GitHub

## Message

```
Improve siphash performance for small keys by up to 30% (#3124)

This removes the partial buffer handling from the full slice api.

`./benchmark --filter siphash --count 1024`

old

    siphash(1,3)
       iterative: 3388 MiB/s [67532e53a0d210bf]
      small keys: 1258 MiB/s [948c91176a000000]
    siphash(2,4)
       iterative: 2061 MiB/s [f792d39bff42f819]
      small keys:  902 MiB/s [e1ecba6614000000]

new

    siphash(1,3)
       iterative: 3410 MiB/s [67532e53a0d210bf]
      small keys: 1639 MiB/s [948c91176a000000]
    siphash(2,4)
       iterative: 2053 MiB/s [f792d39bff42f819]
      small keys: 1074 MiB/s [e1ecba6614000000]
```

## Parents

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

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