# std: Make the CRC32 calculation slightly faster · gitcafe/zig

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

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

Visibility: public

Requested revision: 61e9e82bdc10110b74bdeb973cc542c7b73a4ae2

Requested commit: 61e9e82bdc10110b74bdeb973cc542c7b73a4ae2

Commit: 61e9e82bdc10110b74bdeb973cc542c7b73a4ae2

Tree: f60c7e2f6b97395dee7602d90ce774f19e01e47e

Author: LemonBoy

Committer: Andrew Kelley

## Message

````
std: Make the CRC32 calculation slightly faster

Speed up a little the slicing-by-8 code path by replacing the
(load+shift+xor)*4 sequence with a single u32 load plus a xor.

Before:

```
iterative:  1018 MiB/s [000000006c3b110d]
small keys:  1075 MiB/s [0035bf3dcac00000]
```

After:

```
iterative:  1114 MiB/s [000000006c3b110d]
small keys:  1324 MiB/s [0035bf3dcac00000]
```

````

## Parents

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

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