You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an experimental patch to avoid allocating Object[] space for temp vars in the IR interpreter on every entry into a method.
The logic here is simple: ThreadContext contains a large pre-allocated Object[] array, and instead of allocating a new array, Interpreter requests a chunk of that. The proper starting offset is propagated along with the array reference.
This does not immediately seem to help interpreter performance; however, I believe this will become important as we remove other major source of allocation like framing and scopes.
Yes, I remember playing with this a while back and noticed no perf. changes. I think we've had independent experiments dealing with tmp array, arg unboxing, etc, but nothing that had all of them in one place -- mostly because the interp starts getting un-DRY-ed.
I think the main issue in all of these experiments is it takes many of them to eliminate enough allocation to see any individual one. In that sense, so long as we can do these really cleanly then we should just start chipping away. Unboxing all arity path through calls is another obvious micro-opt. I have also toyed with statistics to use partial evaluators for mini-methods which use hardly any instructions.
With that said, I have been resisting these micro-opts. My current thesis to JRuby performance is hot code JITs and non-hot code should start interp'ing quickly. I may be idealistic but I think this interp work will have less payoff than concentrating on JIT compiler optimizations. I also would like cleaner interp code (well cleaner than right now).
This is an experimental patch to avoid allocating Object[] space for temp vars in the IR interpreter on every entry into a method.
The logic here is simple: ThreadContext contains a large pre-allocated Object[] array, and instead of allocating a new array, Interpreter requests a chunk of that. The proper starting offset is propagated along with the array reference.
This does not immediately seem to help interpreter performance; however, I believe this will become important as we remove other major source of allocation like framing and scopes.
Patch is here: https://gist.github.com/headius/fad70bf08a1ebc96dc68
I'm playing with some other modifications to get IR interpreter performance a bit higher.
cc @subbuss @enebo
The text was updated successfully, but these errors were encountered: