Android App start-up HUGE improvement#2194
Android App start-up HUGE improvement#2194uzzyDC wants to merge 2 commits intofloccusaddon:developfrom
Conversation
… time from 10 seconds to 0.1 seconds with 5k bookmarks and sd 8gen2. Hash is not required prior loading tree view, but only prior remote sync to check for differences.
|
I think I introduced an issue with andoid app sync, I'm checking Native/Action.js to fix it. |
…n: skipHash: boolean = false
|
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", |

#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.