-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Allow compiling editor with target=release
for aggressive optimization
#60355
Allow compiling editor with target=release
for aggressive optimization
#60355
Conversation
d73aed5
to
bae9c67
Compare
I've started to modify the Android Gradle code to make this work for the Android editor, but I haven't got it to work yet. Note that if you intend to test the Android buildsystem, you should cherry-pick #60358 on top to see a difference in terms of performance and binary size. |
bae9c67
to
5476971
Compare
@Calinou For Android, you also have to update the editor/build.gradle and lib/build.gradle to enable the |
5476971
to
6a21364
Compare
Building for Android with |
@Calinou Once you apply the feedback in the comments, you should be able to build and run the editor for release builds. |
6a21364
to
82810ce
Compare
I applied the feedback, but I unfortunately can't test this locally anymore as my Android development setup broke (likely after upgrading my system to Fedora 36). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated Android build logic is mostly there, just some minor cleanups :)
This keeps the required debug functionality enabled, but `-O3` is used instead of `-O2`. The resulting binary is a few megabytes larger, but there are non-negligible run-time performance gains, including editor startup and shutdown speeds.
82810ce
to
0faac33
Compare
Just to comment that having a build called |
The goal of this PR is to remove usability roadblocks with regards to compiling Godot. Adding a new target would defeat this goal, so I'd rather do something like print a message when the build starts instead:
|
@Calinou @akien-mga Given the recent refactor of the build architecture, do we still see values in enabling this for the editor target? |
Yeah, I'm also curious if there is any value in this at all after the refactor. |
I think Lines 548 to 549 in a8c805b
Edit:
Closing, as this was made obsolete by #66242. A |
This keeps the required debug functionality enabled, but
-O3
is used instead of-O2
.The resulting binary is a few megabytes larger, but there are non-negligible run-time performance gains, including editor startup and shutdown speeds.
Note: Binaries compiled with
tools=yes target=release_debug
will now use.opt.debug.tools
suffix instead of.opt.tools
.tools=yes target=release
will use.opt.tools
as before. Adjust your build/CI scripts accordingly.Benchmark
Time to open and quit project manager
Without link-time optimization
With link-time optimization
Time to open and quit editor on empty project
Without link-time optimization
With link-time optimization
Editor binary size comparison (after running
strip
)Without link-time optimization
tools=yes target=release_debug
: 107,600,752 bytestools=yes target=release
: 114,576,240 bytesWith link-time optimization
tools=yes target=release_debug
: 105,827,256 bytestools=yes target=release
: 108,252,144 bytes