This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
Implement non-boxing invokers for methods returning value types #45
Labels
assembly-generation
For things in the generation step
enhancement
New feature or request
performance
CPU time is a precious resource
Currently, Unhollower uses
il2cpp_runtime_invoke
, which boxes returned values if they have value types. This boxing happens in the invoker function, so a simple replacement for runtime_invoke seems non-viable - instead, custom invokers (plus perhaps a custom runtime_invoke) need to be generated to allow for non-boxing returns of value types. Like all allocations, this boxing can degrade performance quite a lot.To solve this, custom invokers that don't box the returned value can be generated. Ideally, invokers would be generated at runtime. However, given the difficulty of achieving that for multiple platforms while keeping compatibility with C++ exceptions, a precompiled native library with invokers for most-common method signatures might be a good middle ground.
Naturally, assembly generation must be changed to make use of those non-boxing invoker methods.
The text was updated successfully, but these errors were encountered: