-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Enable method type information on release builds #53545
Conversation
This is needed to ensure GDScript compilation works properly on release builds and make use of optimized typed instructions.
Does it fix #51060? (Well I guess we can ask there once merged, the two reproduction projects are fairly complex.) |
Thanks! |
It should. I couldn't try out the projects because they are outdated and can't run on current master. |
I assume this chage did not go into the recent pre-alpha release? We'll test this against current master, probably next week. |
I understand this was needed, but I hope a better solution can be found in the future. Type information should not be included in release builds (because of its effect on binary size, which is mentioned here, but also memory and startup speed). I don't know how the GDScript VM works, but maybe this could be solved by the editor adding the required type information when exporting the game, or with AOT compilation. |
@neikeq there's not much that can be done because scripts are compiled when loaded, even in release builds. My plan is to add an IR that would be created on export, so no compilation needed on export (could even remove the GDScript compiler but it doesn't do much of a difference). The only issue is that technically you can create scripts dynamically, which would need compilation, but we can forbid typing on those. The argument names aren't needed, if I added them here was by an oversight. |
Would type hints be forbidden entirely when compiling a script at run-time, or just ignored? I have a project that relies on run-time GDScript compilation, and I'd like it to be able to compile the same GDScript code as the editor. |
This is needed to ensure GDScript compilation works properly on release builds and make use of optimized typed instructions.
Also fix a bug with ptrcalls in the GDScript VM.
This do increase the binary size. For comparison, here's the sizes I got in my machine for the Linux release build, compiled with
production=yes
and then stripped:master: 60 868 416 bytes (58.05 MiB)
this pr: 64 202 560 bytes (61.23 MiB)
difference: 3 334 144 bytes (3.18 MiB)
I was able to run the regression test project without noticing any issue (considering that #53543 is also applied to avoid crashing).