On 12/01/2010 12:38 AM, Charles Oliver Nutter wrote:
On Tue, Nov 30, 2010 at 5:20 PM, Rémi Forax<[email protected]>  wrote:
I hope that Hotspot will never implement stack allocation.
Hotspot currently use TLAB (thread local allocation buffer) which is almost
as fast as stack allocation but without blowing the stack.
I don't know that, but I wouldn't be surprised. The main problem with
TLAB instead of stack allocation, at least in my mind, is that TLAB
has to keep sliding to a new memory range while the stack just goes
back and forth. That allows stack-allocated values to maintain much
better cache locality in the presence of heavy allocation rates where
TLAB would already have walked away from previously-allocated objects.
Under high allocation load, I'd be surprised if TLAB could perform as
well as stack allocation.

You're right.

But in that case, you always execute the same code.
So your runtime should do the stack allocation
i.e use int instead of Integer.

Rémi

--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to