-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid JSON deserialization in common trivial cases #11251
Conversation
I have looked at the failing tests:
|
Let's rebase the branch to have the tests run again |
/rebase |
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
1d37170
to
49cccd1
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11251.apk |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #11251 +/- ##
============================================
+ Coverage 31.30% 31.38% +0.08%
- Complexity 3351 3368 +17
============================================
Files 566 566
Lines 41584 41586 +2
Branches 5629 5631 +2
============================================
+ Hits 13016 13052 +36
+ Misses 26624 26587 -37
- Partials 1944 1947 +3
|
Great idea, @starypatyk ! Many thanks! |
This is a very simple approach to reduce time spent on JSON deserialization when reading file data from the local DB - much simpler than originally proposed in #11181.
I have noticed that in my tests, in more than 90% of the cases, the JSON data retrieved from the database is:
"[]"
"null"
The proposed changes handle these common trivial cases without invoking the JSON parser.
With this change and #11227 I have observed that the time spent inside
FileDataStorageManager::createFileInstance
method is less than 10% of the overall time ofFileDataStorageManager::getFolderContent
. Remaining 90% is infileDao.getFolderContent
- as expected.