Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In preparation for solution 3 from #3468 (comment), I have added a benchmark for the case of passing imported enums to a js function.
Current benchmark results is sitting at 212/s ±3.51% (around half a microsecond per function call, which is extremely slow)
Spoiler: I have a (unfinished) branch containing solution 3 and the benchmark goes up to 12,183/s ±1.1% which brings it in line with the 'Call a custom JS class Foo.bar method with structural' benchmark. In my engine, this means I save 2ms per frame in scenes with lots of objects (where set_index_buffer is called often).