jsm
ModuleStore - use a compiled module as a high-performance key-value store
Package: module_store | Hex
Source: GitHub - juulSme/ModuleStore: Compiled-at-runtime modules as high-read-performance key-value stores in Elixir · GitHub
Docs: ModuleStore v0.0.1 — Documentation
I’ve created a small library that (mis)uses module (re)compilation to create very fast runtime storage. It performs extremely well for reads and extremely badly for writes, by design. The API is a simple key-value interface. It should be considered as being in a very early state, it’s not battle-tested at all at this point.
Most Liked
wojtekmach
For some more prior art, also check out GitHub - discord/fastglobal: Fast no copy globals for Elixir & Erlang. · GitHub. But yeah, I believe persistent_term was designed to solve problems like these.
ltd
Is there a reason to not use the erlang builtin :persistent_term.
benwilson512
To be clear modules are also global. If you want a similarly ergonomic API you could just write a wrapper function around the persistent term lookup. As someone’s done a lot with compiled modules in Absinthe persistent term is just so much better.
Last Post!
jsm
The benchmark file is included in the source under bench, maybe I mucked it up somehow? I deliberately tried to keep it simple though. 100 pairs for every type of storage, take only the 50th atom key as quickly as you can.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









