|
|
|
|
|
by tialaramex
20 days ago
|
|
You're correct that by an "as if" rule the JIT may in some cases be able to do this trick, but the specification says you're getting a heap allocation and so in most cases, including the example I gave that's exactly what happens. It doesn't matter that you say this is "much closer to something like using an arena". It's definitely work that we needn't do at all and that's AFAICT that's how Casey ends up over-correcting so badly. > This is pretty much the most efficient one can be after per-object type arenas and simply not allocating. Sure. "A C is pretty much the highest grade one can get in this class, after grades A and B". |
|
Also, a stack is not a separate hardware element of the RAM, it's not faster than a sufficiently hot part of the heap - it just so happens that the current stack frame is pretty likely to be in cache.