Skip to content
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

Open
knah opened this issue Jun 8, 2021 · 1 comment
Open

Implement non-boxing invokers for methods returning value types #45

knah opened this issue Jun 8, 2021 · 1 comment
Labels
assembly-generation For things in the generation step enhancement New feature or request performance CPU time is a precious resource

Comments

@knah
Copy link
Owner

knah commented Jun 8, 2021

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.

@knah knah added enhancement New feature or request performance CPU time is a precious resource assembly-generation For things in the generation step labels Jun 8, 2021
@Kein
Copy link

Kein commented Aug 6, 2021

Performance-wise that'd be real neat.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
assembly-generation For things in the generation step enhancement New feature or request performance CPU time is a precious resource
Projects
None yet
Development

No branches or pull requests

2 participants