Skip to content
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

feat: MLIBZ-2103 Improve SaveListRequest for StoreType.CACHE #158

Conversation

@yuliya-guseva
Copy link
Contributor

commented Mar 30, 2018

Description

Improved SaveListRequest performance for StoreType.CACHE

Changes

Implemented bulk saving pushed items to the cache

Tests

Instrumented

@yuliya-guseva yuliya-guseva requested a review from vinaygahlawat Mar 30, 2018

@codecov-io

This comment has been minimized.

Copy link

commented Apr 2, 2018

Codecov Report

Merging #158 into indev will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##              indev     #158      +/-   ##
============================================
+ Coverage     57.31%   57.34%   +0.03%     
- Complexity      460      461       +1     
============================================
  Files            42       42              
  Lines          3043     3043              
  Branches        475      475              
============================================
+ Hits           1744     1745       +1     
  Misses         1153     1153              
+ Partials        146      145       -1
Impacted Files Coverage Δ Complexity Δ
...in/java/com/kinvey/android/AsyncClientRequest.java 66.66% <0%> (+3.03%) 11% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c81008...f0a36b0. Read the comment docs.

exception = e;
}
}
cache.save(ret);

This comment has been minimized.

Copy link
@vinaygahlawat

vinaygahlawat Apr 3, 2018

Contributor

@yuliya-guseva In the LOCAL_THEN_NETWORK case, is the local cache save happening after the network request? If so, it may make more sense to first save locally to cache before attempting the network operation.

This comment has been minimized.

Copy link
@yuliya-guseva

yuliya-guseva Apr 4, 2018

Author Contributor

I agree, updated. So we have two items saving, the first is before sending items to the server and the second is after sending items to the server, because Items after saving to the server have additinal information in "kmd" and "acl" fields. We have the same logic in sigle save request https://github.com/Kinvey/java-library/blob/408181b6cf54500036b97f35a711b1eb9c98c1c0/java-api-core/src/com/kinvey/java/store/requests/data/save/SaveRequest.java#L68-L76

CustomKinveyListCallback<Person> saveCallback = testManager.saveCustomList(store, persons);
assertNotNull(saveCallback.getResult());
assertEquals(3, saveCallback.getResult().size());
}

This comment has been minimized.

Copy link
@vinaygahlawat

vinaygahlawat Apr 3, 2018

Contributor

Can an assert be added to check that the size of the cache matches the expected result?

This comment has been minimized.

Copy link
@yuliya-guseva

yuliya-guseva Apr 4, 2018

Author Contributor

Added

@vinaygahlawat
Copy link
Contributor

left a comment

LGTM

@yuliya-guseva yuliya-guseva merged commit a18cf3c into indev Apr 4, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@yuliya-guseva yuliya-guseva deleted the feature/MLIBZ-2103_Improve_performance_with_local_data_in_CACHE_store branch Apr 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.