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

chore: upgrade hilt to use ksp #2176

Merged
merged 3 commits into from Sep 5, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 4, 2023

Cherry pick from the original PR:


⚠️ Conflicts during cherry-pick:


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

We're using KAPT, which is in "maintenance mode" and was not made with Kotlin as a first-party language, but rather as a bridge between Java and Kotlin.

KAPT is rather slow compared to KSP.

Solutions

Leverage Dagger's new release (2.48), which is the first to support KSP and remove KAPT from the project completely.

On my machine, I conducted some runs going back and forward between these changes and checked the impact of them.

Consider that we are already using KSP because of compose-destinations, so we already have a couple of seconds of KSP cost in our build time.

I've grouped the tasks related to Hilt/KAPT/KSP and measured how long they're taking:

image

Notice how the kspBetaDebugKotlin was already taking some ≅2.5 seconds because of compose-destinations, and it increases a bit now with hilt running on KSP. But removing KAPT is still a net positive, as it can be see in the summary:

image

KAPT/KSP/Hilt time goes from ≅21s to ≅10s on my machine.

Testing

Tested the app manually.


PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions github-actions bot added the cherry-pick PR is cherry-picking changes from another banch label Sep 4, 2023
@AndroidBob
Copy link
Collaborator

Build 528 succeeded.

The build produced the following APK's:

@AndroidBob
Copy link
Collaborator

Build 534 failed.

@github-actions
Copy link
Contributor Author

github-actions bot commented Sep 5, 2023

Test Results

596 tests  ±0   595 ✔️ ±0   3m 52s ⏱️ +9s
  85 suites ±0       1 💤 ±0 
  85 files   ±0       0 ±0 

Results for commit 9add520. ± Comparison against base commit b310d4d.

♻️ This comment has been updated with latest results.

@ohassine ohassine added this pull request to the merge queue Sep 5, 2023
@AndroidBob
Copy link
Collaborator

Build 543 succeeded.

The build produced the following APK's:

Merged via the queue into develop with commit 3fe2d28 Sep 5, 2023
12 of 14 checks passed
@ohassine ohassine deleted the chore/upgrade-hilt-to-use-ksp-cherry-pick branch September 5, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick PR is cherry-picking changes from another banch size/S
Projects
None yet
4 participants