orgzly-android icon indicating copy to clipboard operation
orgzly-android copied to clipboard

Git sync: SyncUtils.groupAllNotebooksByName(dataRepository) takes longer as history accrues

Open amberin opened this issue 3 years ago • 2 comments

:heavy_check_mark: I have searched for existing issues that may be the same as or related to mine.

This should be investigated -- I don't know what causes it.

I suppose it could be old temp branches laying around, which requires more looping to be done at some point? Or something similar.

I have noticed a quite long delay before all notebooks have their status updated to "syncing", so it's somewhere before that.

It is definitely not related to the size of the repo history. If I delete the local workdir, and clone the same repo anew, syncing becomes much faster.

Come to think of it, this could theoretically be unrelated to Git syncing, as I cannot compare with other repo types.

amberin avatar Jun 05 '22 17:06 amberin

I can no longer reproduce this. Closing.

amberin avatar Dec 02 '22 14:12 amberin

Reopening this as I have run into it again.

The fetching notebooks stage takes longer and longer the longer I use a Git repo. If I remove the repo, and add it back, then fetching notebooks is snappy again. So I assume it has something to do with what builds up in my local .git directory.

So far, I have only narrowed the delay down to this place in the code: https://github.com/orgzly/orgzly-android/blob/master/app/src/main/java/com/orgzly/android/sync/SyncWorker.kt#L160

I will try to do some profiling the next time the problems re-appears.

amberin avatar Dec 29 '22 23:12 amberin