Hubmakerlabs / replicatr

Nostr relay with Internet Computer integration for inter-relay synchronization
https://mleku.dev/git/replicatr
GNU General Public License v2.0
13 stars 1 forks source link

database event decode free list #39

Open mleku opened 3 months ago

mleku commented 3 months ago

currently, queries repeatedly decode and decode again events that are hot in the cache, especially recent ones that are sent out in open subscriptions of current websocket connections

it would make a lot of sense to eliminate the duplication of both memory and processing required for this data by changing the event decoding library into a freelist that allows avoiding unbounded spikes of memory use and unnecessary re-decoding of the binary data in the database for events that are being heavily accessed concurrently