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

Investigate binary size of SDC library #1331

Closed
jingtang10 opened this issue Apr 25, 2022 · 5 comments · Fixed by #1421 or #1451
Closed

Investigate binary size of SDC library #1331

jingtang10 opened this issue Apr 25, 2022 · 5 comments · Fixed by #1421 or #1451
Assignees
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue type:code health

Comments

@jingtang10
Copy link
Collaborator

Describe the Issue
The SDC library binary size seems very large due to the mlkit dependencies required by the QR code reader. There might be afew solutions:

  1. move the QR code reader to the catalog app
  2. investigate if proguard can strip out the dependency
  3. create a new release (com.google.android.fhir:data-capture-contrib or something similar) for the QR reader

Would you like to work on the issue?
NA

@jingtang10
Copy link
Collaborator Author

Before we make a decision, would be nice to gather some facts:

  • how big is the sdc lib at the moment?
  • how much does the QR code reader add to the library size?
  • Is it easily strippable by proguard if developer is building an app?
  • if not strippable by proguard, can we make it so it is?
  • if not in the sdc lib, does it make sense to create a separate binary for contrib widgets, or shall we just put the code in catalog app as an example, so developers will need to copy and paste the example.

@Tarun-Bhardwaj Tarun-Bhardwaj added Data capture effort:medium Medium effort - 3 to 5 days and removed Triage labels May 6, 2022
@kevinmost
Copy link
Contributor

Looks like the QR reader adds ~7.3MB to the download size of the release APK, and ~13.4MB to the on-device install size.

Presumably it could be stripped by Proguard (~3MB downloaded -> ~8MB installed comes from the .so file, which could just be excluded in Gradle as well). However, as an application developer, I find it much more annoying to maintain a Proguard/Gradle excludes list, versus bringing in another library.

I think that moving this to its own Gradle module, maybe in contrib/datacapture/barcode would be a good start. Maven coords could be something like com.google.android.fhir:contrib-data-capture-barcode:0.1.0-beta03

@kevinmost
Copy link
Contributor

By the way, I did the above investigation with this cool Gradle plugin. Just sent a PR (#1421) to integrate it.

@jingtang10 jingtang10 linked a pull request May 26, 2022 that will close this issue
7 tasks
@jingtang10 jingtang10 reopened this Jun 6, 2022
@jingtang10
Copy link
Collaborator Author

Reopening since this is not done yet. @kevinmost

@jingtang10
Copy link
Collaborator Author

@ekigamba @f-odhiambo @pld FYI

Thanks so much @kevinmost for the investigation and for sending the PR 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue type:code health
Projects
Archived in project
3 participants