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

Massively improve findFile performance #728

Merged
merged 2 commits into from
May 4, 2024

Conversation

raxod502
Copy link
Contributor

Please see #705 for a technical discussion of the issue being solved here. This is a follow-on to tachiyomiorg/UniFile#2, which uses the newly optimized version of UniFile and adjusts findFile callsites to adapt to the removed ignoreCase argument.

As per standard development procedure, this branch can be compiled using ./gradlew assembleDevDebug and installed for testing. I have temporarily configured libs.versions.toml to pull the specific commit from my UniFile branch via JitPack, but this will of course be updated to point to the official repository master branch once the other pull request is merged (and/or the repository, which still lives under the legacy tachiyomiorg organization, is moved under mihonapp).

If you wish to test your own changes to UniFile without pushing to GitHub, the following procedure can be used:

  1. Compile UniFile debug build with ./gradlew assembleDebug, using Java 11 because Java 17 is too recent (e.g. on Ubuntu with the relevant packages installed set JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64).
  2. Comment out the unifile version pin in libs.versions.toml to ensure that no part of the build accidentally pulls from the published version.
  3. Find all occurrences of implementation(libs.unifile) in project build.gradle.kts files and replace them with implementation(files("/path/to/UniFile/library/build/outputs/aar/library-debug.aar")) based on your dev environment's setup.
  4. Compile as usual with ./gradlew assembleDevDebug, using this time Java 21.
  5. (optional) Re-sign APK with uber-apk-signer --overwrite --allowResign -a app/build/outputs/apk/dev/debug/app-dev-arm64-v8a-debug.apk or equivalent, I found that this was necessary because for some reason the default Gradle APK signing would change signature every time the UniFile dependency JAR was rebuilt, leading to a wipe of user data on each app installation.
  6. Install and test per usual. I added logging locally to the download provider and queue management to verify performance metrics.

DCO statement: The contribution was created in whole by Radian LLC, which attests its right to submit it to the project under the terms of the Apache License.

@AntsyLich
Copy link
Member

Thanks for the PR!

@AntsyLich AntsyLich merged commit 7ec2108 into mihonapp:main May 4, 2024
1 check passed
@raxod502 raxod502 deleted the rr-improve-findfile-performance branch May 4, 2024 19:53
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants