On Sat, Apr 23, 2011 at 6:50 AM, Phil <[email protected]> wrote: > Hmm, I can't see that working, as the stack for one thread will not be > available to others. The optimiser would have to satisfy itself that > such an object was only accessible by one thread at a time, and it > would have to move the object around between stacks as the parent came > into scope in different threads. Heap sounds safer, simpler and more > performant.
Stack is definitely faster in a small set of cases. Search for "escape analysis" you should get stuff that relates to this. I think the term is also "scaler replacement." (Quick link: http://blog.juma.me.uk/2008/12/17/objects-with-no-allocation-overhead/) -- You received this message because you are subscribed to the Google Groups "The Java Posse" 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/javaposse?hl=en.
