-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Disable all 3D nodes, physics, and resources when compiling without 3D #89381
Conversation
Changes look good to me. Somewhat surprisingly though, this seems to make a
Building with Not a big difference though, 156 KiB / 0.3% increase. But that's still a bit surprising when excluding more stuff.
I tried without
Exactly 16 KiB increase, which is just 0.03%. So not very significant. So overall this just seems not to have much impact on the binary size as is, which is a bit puzzling. Tested on a super minimal build, no size difference:
Built with
where |
Tested a minimal build with debug symbols to run
Without LTO (needed to have usable debug symbols), I do get a more significant size difference. So LTO seems to do a good job at removing unneeded 3D code even without this PR.
148 KiB removed, i.e. 0.75%.
This PR:
Full bloaty |
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.
Confirmed building and testing works (i.e. does not introduce any regressions with debug templates and running tests)
Thanks! |
This PR disables all 3D nodes and resources, and ensures that some key files like World3D are not included anywhere, when compiling with 3D disabled. A summary of some of the changes:
Overall these changes are surprisingly clean, the last 4 bullets are just good fixes for including what you use. The big messy change is in the servers folder, with all the
env.add_source_files
lines in the SCsub file. I am of the opinion that we should move the server files into the server folders (like move PhysicsServer3D into theservers/physics_3d
folder). But that should likely be a separate PR (maybe as a prerequisite to this one? or we can merge this first).