You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an idea that concerns about-self, but in general applies to any leveldb index where each KV is a reduced state of somehow (e.g. about-self, ssb-friends, etc).
We need to apply processRecord on the previous state, so that's why we load all the states on startup time. But this costs almost 1sec during startup. 1 second times N "state-sensitive indexes" is N seconds.
Alternatives:
Load all states at startup time
This is what we currently do
Good for cases when there will be tons of processRecords called in succession, e.g. initial indexing
Bad for cases where the index is large and there won't be many processRecords afterwards, e.g. opening up the SSB app every day
Load each state just-in-time
Such as loading it inside processRecord, right before pushing to the batch array
Good for cases when there are few processRecord calls, e.g. every day SSB usage
Bad for initial indexing
Load up everything as soon as we detect lots of processRecord calls
Otherwise use the JIT technique
Might be a compromise, but seems tricky to implement, and there could be corner cases we don't see yet
Overall the question is how to load and update indexes which are state sensitive.
The text was updated successfully, but these errors were encountered:
This is an idea that concerns about-self, but in general applies to any leveldb index where each KV is a reduced state of somehow (e.g. about-self, ssb-friends, etc).
We need to apply
processRecord
on the previous state, so that's why we load all the states on startup time. But this costs almost 1sec during startup. 1 second times N "state-sensitive indexes" is N seconds.Alternatives:
processRecords
called in succession, e.g. initial indexingprocessRecords
afterwards, e.g. opening up the SSB app every dayprocessRecord
, right before pushing to the batch arrayprocessRecord
calls, e.g. every day SSB usageprocessRecord
callsOverall the question is how to load and update indexes which are state sensitive.
The text was updated successfully, but these errors were encountered: