-
-
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
Don't box params on Native->C# calls with Variant params #44106
Don't box params on Native->C# calls with Variant params #44106
Conversation
@@ -38,15 +38,16 @@ | |||
class GDMonoMethod : public IMonoClassMember { | |||
StringName name; | |||
|
|||
int params_count; | |||
uint16_t params_count; |
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.
Same here.
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.
It's always initialized in the constructor, in the call to update the method signature. Is there a performance penalty in adding a default value here?
4283a82
to
ed46171
Compare
Godot uses Variant parameters for calls to script methods. Up until now we were boxing such parameters when marshalling them for invokation, even if they were value types. Now Godot allocates the marshalled parameters on the stack, reducing the GC allocations resulted from boxing.
ed46171
to
a946f84
Compare
Thanks! |
Godot uses Variant parameters for calls to script methods. Up until now we were boxing such parameters when marshalling them for invokation, even if they were value types.
Now Godot allocates the marshalled parameters on the stack, reducing the GC allocations resulted from boxing.