- 
                Notifications
    
You must be signed in to change notification settings  - Fork 10
 
GFXR: Improve developer build times by hiding git SHA #477
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
base: main
Are you sure you want to change the base?
Conversation
| 
           Thanks for making this change.  | 
    
          
 I have the same concern. I was hoping that splitting  The other option is that we remove the SHA altogether. That might be fewer lines of code and may build even faster by reducing the need to link as well.  | 
    
Every time the git SHA changes (new commit, branch change, etc), it would take 1+ minutes to build GFXR. This was caused by many large C++ files including a header file which contained the SHA; every time the SHA changed, those files would need to be recompiled. Since they were large files, this ended up taking a long time. Instead of consuming the SHA directly, hide it behind a function call and let the linker deal with it. This reduces the number of targets to recompile every time the git SHA changes. The only exception is version.rc which wants a string literal.
12dc897    to
    5c1756e      
    Compare
  
    | 
           FWIW I found that my laptop was on the "balanced" power profile. If I increase Processor Power Management > Minimum Processor State > Plugged in to 100%, it takes 46s without this fix and 6s after. My test: # Build the layer once to generate a baseline
gradlew layer:assembleDebug -Parm64-v8a
# Generate a new SHA without code changes
git commit --allow-empty -m "test"
# Rebuild layer with only the SHA change
gradlew layer:assembleDebug -Parm64-v8a | 
    
          
 that is great, thanks for verifying the actual gain.  | 
    
| 
           I'm going to create a PR upstream to increase the impact of the fix as well as reduce the number of conflicts.  | 
    
Every time I changed a git branch or made a commit, it would take 1+ minute to build GFXR. This was caused by many large C++ files including a header file which contained the git SHA; every time the SHA changed, those files would need to be recompiled. Since they were large files, this took a long time.
Instead of consuming the SHA directly, hide it behind a function call and let the linker deal with it. This reduces the number of targets to recompile every time the git SHA changes. The only exception is version.rc which wants a string literal.