For your information, the parameters used in Tasks, are generic (BBParameter) and designed to work in a way that there is no value boxing/unboxing to avoid allocations throughout the whole pipeline that they are used.
The Script Control Tasks in the “Standalone” category specifically, already turn methods and properties into delegates and everything is strongly typed, so that once again boxing/unboxing is totally avoided. Please take a look at the ReflectedAction and ReflectedFunction for example on what is going on behind the scenes if you want.
The only exception to the above is when using the Script Control Tasks under the “Multiplatform” category, within which there is no delegation because (as you probably already know) AOT compilers like iOS, need to know the all the delegates type signature that will be used, “ahead-of-time”, and which is practically impossible to foresee for all possible combinations of parameter/return types that exist in a multi-parameter method for example.
If you interface only with methods with one or no parameters (or properties), you can still use the Script Control Tasks under the “Standalone” category to take advantage of the strongly typed delegation that already takes place to avoid value boxing/unboxing even in AOT platforms.
Thanks.
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.