aset-* and aget perform poorly on multi-dimensional arrays even with type hints.
Here's a transcript of the behavior. I don't know for sure that reflection is being done, but the performance penalty (about 1300x) suggests it.
One workaround is to use multiple agets.
Cause: The inlined version only applies to arity 2, and otherwise it reflects.
Bump – can you consider picking this up again for 1.11? The patch is complete; however, if it seems too complicated, it can be simplified.
Thanks for the answer. In terms of complexity, I can remove the part that "optimizes" reflective calls, which both simplifies the algorithm and makes the reflection sites visible to the compiler (and thus to the user).
It's complicated, not sure if its worth this or not. Probably won't look at it for 1.10.
Is there a chance to review this for 1.10? Perhaps, the implementation is too complicated and needs more time to consider? I might try to reduce the scope then.
BTW, why does the docstring for aset says it works only on arrays of reference types? Is this comment outdated? We can fix it it along the way.