Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/toffaletti/zig-array-map

ArrayMap data structure for Zig
https://github.com/toffaletti/zig-array-map

zig

Last synced: 14 days ago
JSON representation

ArrayMap data structure for Zig

Awesome Lists containing this project

README

        

# Zig ArrayMap

ArrayMap is a data structure that maps keys to values using an array of entries, optionally kept sorted by key. The contiguous layout in memory is cache friendly and can make ArrayMap a good choice for small amounts of data or data that is already sorted, written infrequently, but read many times.

```
┌┬────────────┬┬────────────┬┬────────────┬~
││ Entry ││ Entry ││ Entry │~
│├────┬┬──────┤├────┬┬──────┤├────┬┬──────┤~
││Key ││Value ││Key ││Value ││Key ││Value │~
└┴────┴┴──────┴┴────┴┴──────┴┴────┴┴──────┴~
```