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 #2174

Merged
merged 2 commits into from
Sep 4, 2023

Conversation

vitorhugods
Copy link
Member


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.

@vitorhugods vitorhugods requested review from a team, yamilmedina, alexandreferris, borichellow, MohamadJaara and saleniuk and removed request for a team September 4, 2023 14:35
@vitorhugods vitorhugods enabled auto-merge (squash) September 4, 2023 14:45
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Test Results

586 tests   585 ✔️  6m 41s ⏱️
  84 suites      1 💤
  84 files        0

Results for commit b50afc2.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 514 succeeded.

The build produced the following APK's:

@vitorhugods vitorhugods merged commit 7bba4df into release/candidate Sep 4, 2023
6 checks passed
@vitorhugods vitorhugods deleted the chore/upgrade-hilt-to-use-ksp branch September 4, 2023 16:44
github-actions bot pushed a commit that referenced this pull request Sep 4, 2023
@github-actions github-actions bot mentioned this pull request Sep 4, 2023
4 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 524 succeeded.

The build produced the following APK's:

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

Successfully merging this pull request may close these issues.

5 participants