Sometimes I Need to Store a Lot of Strings Efficiently, So I Built lite-strtab
This post is about a very specific problem.
Storing many short, long-lived strings in an immutable (read-only) container.
All while keeping memory overhead low and lookup performance practical.
Every once in a while I run into the same problem: I have a lot of strings to keep, and I want to save a bunch of memory.
Think of stuff like:
- A
catalogordatabasesnapshot you download to see what is available - Your game's localisation strings
- Static lists of paths, endpoints, or keys
Something you load once, keep around for a while, and query every once in a while.