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

Build Speed - using static git information for debug build config #5668

Closed
wants to merge 3 commits into from

Conversation

ouchadam
Copy link
Contributor

@ouchadam ouchadam commented Mar 30, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Only applies the git meta information to release builds, by dynamically including it in all build types we end up invalidating our local caches causing cascading compilation across the modules

Motivation and context

To speed up the build when no code changes have been made

Screenshots / GIFs

Notice the dev mentions instead of the current git sha for the debug build

ONBOARDING ABOUT
Screenshot_20220330_133854 Screenshot_20220330_133841

Tests

Setup

./gradlew assembleGplayDebug  # 3m 30s~
./gradlew assembleGplayDebug  # 1s

git commit -m "empty commit" --allow-empty # or checkout a new branch

The next build after changing git sha...

Before

./gradlew assembleGplayDebug  # 3m~

After

./gradlew assembleGplayDebug  # 18s~

Hopefully in the future we'll be able to automate this benchmark gradle/gradle-profiler#335

**note build times are dependent on system specs

Tested devices

  • Physical
  • Emulator
  • OS version(s): 31 Sv2

- avoids commits causing module invalidation, increasing the build time
@ouchadam ouchadam requested review from a team and ericdecanini and removed request for a team March 30, 2022 13:13
@github-actions
Copy link

Unit Test Results

110 files  ±0  110 suites  ±0   1m 17s ⏱️ +10s
195 tests ±0  195 ✔️ ±0  0 💤 ±0  0 ±0 
650 runs  ±0  650 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit f739ca1. ± Comparison against base commit 9d3d574.


buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\""
buildConfigField "String", "GIT_REVISION_DATE", "\"${gitRevisionDate()}\""
buildConfigField "String", "GIT_BRANCH_NAME", "\"${gitBranchName()}\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's quite annoying not to have the branch name. I use it to check that I am on the correct version when installing an APK built from Buildkite.
I guess I can live without that. Or we can include it when built on the CI, but not when built on a local computer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also agree, I find the branch name quite useful for quickly confirming build origins

I'll have a bit more of a play around which the separate cacheable module approach to see if there's a way to play nice with the SDK project (without resorting to releasing a another artifact)

Copy link
Contributor

@ericdecanini ericdecanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with what @bmarty says. It would be good to get the branch name back

@ouchadam
Copy link
Contributor Author

going to close and revisit the module + scripting approach after my current tasks are complete

@ouchadam ouchadam closed this Mar 31, 2022
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.

3 participants