# stage1: reimplement HashMap · gitcafe/zig

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

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

Visibility: public

Requested revision: 8b82c40104802c9351b30ef7c5a41e7829ab6d2a

Requested commit: 8b82c40104802c9351b30ef7c5a41e7829ab6d2a

Commit: 8b82c40104802c9351b30ef7c5a41e7829ab6d2a

Tree: 8ba2c9c73e5c53db9c902a204ecb179539703dff

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage1: reimplement HashMap

The indexes are stored separately using an array of
uint8_t, uint16_t, uint32_t, or size_t, depending on the number of
entries in the map.

Entries only contain a key and a value, no longer have
distance_from_start_index or is_used.

In theory this should be both faster and use less memory.

In practice it seems to have little to no effect. For the standard
library tests, vs master branch, the time had no discernable
difference, and it shaved off only 13 MiB of peak rss usage.

```

## Parents

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

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