Android App start-up HUGE improvement#2194
Android App start-up HUGE improvement#2194uzzyDC wants to merge 0 commit intofloccusaddon:developfrom
Conversation
|
I think I introduced an issue with andoid app sync, I'm checking Native/Action.js to fix it. |
|
I've tried to achieve the same thing with fewer changes, but didn't have time to test if this actually works: #2195 |
|
The fact is that NativeTree.load() Hash calc should be ignored only for app startup calls, when the tree view is loaded. The following calls behaviour should remain the same, reason why I introduced a skipHash parameter, which should have default value false (last commit on my branch). NativeTree.load() is invoked in actions.js and NativeAccount.get(). |
That's likely a race condition, we might be able to prevent this by using a lock
Why would it be called again?
I cannot reproduce that, for me #2195 works |
| const newHash = await this.bookmarksCache.hash(this.hashSettings) | ||
| // this.bookmarksCache.cachedHash = newHash | ||
| // await Storage.set({ key: `bookmarks[${this.accountId}].treeHash`, value: newHash }) // optionally persist hash | ||
| this.highestId = parseInt(highestId) |
There was a problem hiding this comment.
highestId also needs to be set when skipHash is true
| return false | ||
| } | ||
| else { | ||
| // oldHash = this.bookmarksCache?.cachedHash ?? await this.bookmarksCache?.hash(this.hashSettings) |
There was a problem hiding this comment.
Please don't commit commented-out lines, it makes things hard to read ;)
| "chai": "^4.2.0", | ||
| "chai-as-promised": "^7.1.1", | ||
| "chrome-webstore-upload": "^0.4.2", | ||
| "cross-env": "^10.1.0", |
There was a problem hiding this comment.
This dependency addition seems unnecessary?
There was a problem hiding this comment.
I'm on windows, not sure is really needed, but I didn't want to push it.
| "isomorphic-git": "1.x", | ||
| "js-base64": "^3.7.5", | ||
| "lodash": "^4.17.20", | ||
| "oboe": "^2.1.7", |
|
mmh, Why did you close this? |
|
It wasn't intentional. I don't see any "repon" button, maybe need to make a new commit to enable it. Btw the plan is to merge this or your perf/native-startup branch? thanks |
|
I can reopen for you :) |
|
mh, i cannot, it seems |
No plan yet. I'm looking forward to you testing my branch. Personally, I find my approach more elegant, but it might not yield the same benefits. EDIT: OK, just tested without the fix from the perf branch and it takes ages with my artificially large collection: 4s vs >10s |
Is that with the official build from the releases here on github / from F-Droid / from Google Play? Or with a manual build? Did you check with logcat? |
Manual build from your perf/native-startup branch. Here is the logcat: Strangely, when I startup the app the first time, is not displaying the menu to setup the profile, but directly the tree loading screen, which never finishes. |
|
Mh, maybe the stored data is corrupt. Can you try deleting the app storage and cache in the Android app settings and retry with a clean slate? |

#2170 Removed hash calculation during android native app start up. Hash is not required prior loading tree view, but only prior remote sync to check for differences.
Start up time from 10-15 seconds to 0.1 seconds with 5k bookmarks and sd 8gen2.