Some queries hang for a long time
Sometimes, item queries hang for a long time. This does not always happen - even with the same set of libraries on a device. It might be related to overall system use or something like that.
In any case, we shall:
- Try to understand what happens - and ideally why.
- Improve the access speed to the cache. It might be we currently block it for too long in some situations or something like that.
- Generally, some "framework" to measure runtimes of cache jobs might be helpful.
- Lastly, we might want to consider making jobs cancelable. Currently, this is not the case, so we might create a lot of jobs that cause stress on the cache. Also, if we leave a page with some pending jobs created by it, these will still be run, even though the recipient will never read the data retrieved by these jobs.
Update
Currently, we consistently use LMDB write transactions. This means, per environment, exactly one transaction runs at the time. In our case, this eventually means we have one running transaction at all! We should ensure that we create read only transactions at least for the jobs that only read from the cache.
Update 2
With the optimisation implemented, the performance seems way better. Still, some views (in particular the Schedule view) need a moment to update. It might make sense trying to look into further improvements before finally closing this issue.