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

DataStore Model Sync Parallelization #2808

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

tylerjroach
Copy link
Contributor

  • PR title and description conform to Pull Request guidelines.

This PR attempts to speed up sync times when no associations are present on any models. This is to bring Android into parity with Swift.

Future optimizations could be:

  1. To create model association groups to allow for parallelization when connected models are present.
  2. Enable a high concurrency count by default. Right now, the proposal on Android is to default to 1.
    • I have some concerns about high memory usage on Android if the customer has a large number of models, with a large number of records per model. An Android app is only allowed an allotted size of memory. In the current Android implementation, network requests are accumulated while local merger reconciliation is processing. By increasing the parallelization limit, if the local merger reconciliation limit is the bottleneck, a large number of records could be allowed to accumulate in memory before the merger can discard network responses. Many customers have a large number of models, but small number of records per model. For these customers, the time savings by enabling concurrency will be significant. Swift apps are allowed to use a higher amount of memory so there is less of a concern on that platform.

Issue #, if available:

Description of changes:
Comparable Swift Optimization: aws-amplify/amplify-swift#1267

How did you test these changes?
(Please add a line here how the changes were tested)

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2024

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 44.03%. Comparing base (0f61cc8) to head (15da6ac).
Report is 29 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2808      +/-   ##
==========================================
+ Coverage   43.00%   44.03%   +1.02%     
==========================================
  Files         905      925      +20     
  Lines       29179    30245    +1066     
  Branches     4153     4298     +145     
==========================================
+ Hits        12549    13318     +769     
- Misses      15271    15500     +229     
- Partials     1359     1427      +68     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants