absinthe
absinthe copied to clipboard
Subscription Memory Improvements
The idea here, per a conversation with @josevalim is to try to minimize the amount of information that is duplicated when clients subscribe to multiple documents.
The largest value that is generally duplicated today is the context. Initial results show:
5x improvement for clients with lots of subscriptions per client (150). 3x Improvement for clients with a low number of subscriptions per client (7).
Those numbers double to 10x and 6x on Elixir master where Registry supports compressed :ets
tables.
Approach
The main idea here is that Absinthe adds a second Registry with :unique
keys, and we'll use this registry to manage singular values (like the context) associated with that process.
Current Issues
- [ ] A process is only allowed to have a single context. This isn't necessarily true.
- [ ] Unregister probably doesn't work
- [ ] The lack of failing test cases highlights some missing coverage around context management.
@benwilson512
In my company, we have an excellent use case where we could benefit from what this PR was addressing originally and we might have time to work on this in the next few days. Do you think this is something you and the Absinthe team still want to address? We'll be glad to contribute if you're interested, if yes is there is any advice for moving it forward?
and we might have time to work on this in the next few days.
Hey that's exciting to hear! Please shoot me an email at ben [dot] wilson [at] cargosense [dot] com
I'd love to get a minute to chat with you about it.