💾 Archived View for gemini.panda-roux.dev › log › entry › 63 captured on 2023-06-16 at 16:19:10. 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 -