💾 Archived View for gemini.panda-roux.dev › log › entry › 63 captured on 2023-04-26 at 13:05:21. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Posted on Tuesday August 2, 2022
MoonGem 2.3 includes an in-memory key/value store. This allows for keeping persistent state across requests.
The entire feature is abstracted into the `mg.store` Lua table. Any primitive value stored in that table will be persisted in-memory and available to subsequent requests.
I used the popular and very fast Wyhash library in order to compute key hashes.
Collision resolution is handled via linear probing. This approach guarantees very fast insertion and lookups in exchange for a necessarily low load factor (and therefore higher memory usage than other methods).
Here's the commit wherein I added this feature
- panda-roux -