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

Disable registering 3D physics types when 3D is disabled #79185

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Jul 8, 2023

This PR organizes the 2D and 3D physics code in register_server_types.cpp and allows the 3D physics type registration code to be disabled by wrapping it in #ifndef _3D_DISABLED.

In the current master, a macOS arm64 template_release build is 66.5 MB (66503407 bytes). Using disable_3d=yes brings this down to 60.2 MB (60224255 bytes), a reduction of 9.4%.

With this PR, the disable_3d=yes build is 58.8 MB (58848751 bytes), a reduction of 2.3% compared to master with this option, and brings the total savings from 9.4% to 11.5% compared to 3D enabled, a reduction of 2.1%.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Feb 22, 2024
@akien-mga akien-mga merged commit e8758a0 into godotengine:master Feb 22, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@AThousandShips
Copy link
Member

This caused a regression, looking into a fix right now:

@aaronfranke
Copy link
Member Author

Apologies for the regression, I try to test these PRs thoroughly when I make them but it can be hard to keep up with testing after rebasing. I'm glad it was resolved quickly though.

@aaronfranke aaronfranke deleted the reg-phys-3d branch February 22, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants