Skip to content

Reduce binary size used for loading method binds (~200-400kb reduction!) - #2067

Open
dsnopek wants to merge 1 commit into
godotengine:masterfrom
dsnopek:binary-size-method-binds
Open

dsnopek wants to merge 1 commit into
godotengine:masterfrom
dsnopek:binary-size-method-binds

Conversation

@dsnopek

@dsnopek dsnopek commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

When building the test project on Linux (the Windows binaries were cross-compiled) this will generate a binary that is ~200-400kb smaller!

Platform / Compiler Size Before Size After Change
Linux / GCC 13 2,866 KB 2,469 KB -397 KB (-13.9%)
Linux / Clang 18 3,063 KB 2,843 KB -220 KB (-7.2%)
Windows / MinGW GCC 13 2,100 KB 1,750 KB -350 KB (-16.7%)
Android / NDK 28.1 1,161 KB 958 KB -203 KB (-17.5%)

This works by inlining fewer things, moving some of the generated code into helper functions, and removing ERR_PRINT_ONCE() from CHECK_METHOD_BIND*()

It's very similar to these PRs from @Ivorforce on the Godot repo:

@dsnopek dsnopek added this to the 10.x milestone Oct 7, 2026
@dsnopek
dsnopek requested a review from a team as a code owner October 7, 2026 18:15
@dsnopek dsnopek added the enhancement This is an enhancement on the current functionality label Oct 7, 2026
@dsnopek
dsnopek requested a review from Ivorforce October 7, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an enhancement on the current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant