Skip to content

Update firebase mappings to improve performance on large surveys - #3868

Open
andreia-ferreira wants to merge 5 commits into
masterfrom
andreia/3866/improve-large-survey-load
Open

Update firebase mappings to improve performance on large surveys#3868
andreia-ferreira wants to merge 5 commits into
masterfrom
andreia/3866/improve-large-survey-load

Conversation

@andreia-ferreira

Copy link
Copy Markdown
Collaborator

Towards #3866

Loading large surveys could be very slow. One of the factors was using expensive java reflection lookups on every field of every LOI as well as storing unused properties that could be very large (especially if whisp integration is enabled on the survey). This PR optimizes that:

  • Added LoiGeometryConverter to read geometry directly from the Firestore document instead of through the reflection-based proto mapper
  • Filter LOI properties and only store the ones that the app uses
  • Cache resolved builder methods (declaredFunctions was re-running for every field of every document)
  • Set FIRESTORE_LOGGING_ENABLED as false in release builds, as writing down logs for large surveys can be quite heavy

After testing with some user surveys from Vietnam, these changes were shown to cut in half the time needed to download

@shobhitagarwal1612 PTAL?

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.

1 participant