The problem: on my fastest machine, syncing a device that hasn’t been online already takes more than a minute per day.
The impact: This means if a device hasn’t been online for a week, which at least for me happens regularly, it’s unusable for 7+ minutes because sync goes from oldest to newest, so anything I write is at a completely wrong position in the history (since it gets inserted wherever the sync has gotten) and I can’t read answers anyway for 7+ minutes until I get to the current time responses.
The ugly: On my slowest device, syncing a day takes up to 15 minutes.
I’m not sure how you would address this. Perhaps one solution might be to sync newest to oldest, and to keep checking for new stuff during sync.
Signal desktop “solves” this by showing a splash screen while syncing.
I think the bottleneck is SQLite doing fsync after each transaction, so it should be possible to speedup by grouping more SQL statements into transactions and doing all writes in the same place, but it is not as easy as it sounds and requires large refactoring.
yeah, it can probably be improved and there are also ideas around that. esp. when using slow server, slow network and/or slow devices.
however, using a fast chatmail server, syncing some 100 messages per day after being offline for some days is usually fine on most devices [1]. that said, i do not see a “fundamental roadblock” here, the issue more queues in with lots of other things
My apologies, but my reasoning was if I need to wait 10-30 minutes to be able to use the app, I thought for many users that’d be somewhat of a fundamental issue.
Hello, this is quite the problem for me too, as I have a laptop that I only use during travels and so I don’t synchronize it very often, and it can take a very long time to sync (10+ minutes!), time during which it gets very hot.
That means there’s a lot of computing happening, which would indicate the SQLite waiting for the storage to sync is not the culprit. Moreover, the large majority of the computing doesn’t happen in deltachat-rpc-server but in the deltachat-desktop processus, which would indicate that the GUI is slowing everything down.
While synchronizing, the GUI updates quickly with every message. I tried minimizing the GUI but it still consumed a lot of CPU.
I’ve got a similar on my Android tablet, which I don’t use often either. It’s even slower to sync than the laptop because it’s a little old.
Anyways, I would rather have a wait screen if it means the synchronization is faster. I cannot use Deltachat while it’s synchronizing anyways.