Am 22.10.2013 14:26, schrieb Bruno Medeiros:
On 20/10/2013 20:23, bearophile wrote:
From what I've seen escape analysis is not bringing Java close to D
performance when you use 3D vectors implemented as small class
instances. We need something that guarantees stack allocation if there's
enough space on the stack.
If my recollection and understanding are correct, that's not due to a
limitation in the algorithm itself of Java's escape analysis, but
because Java arrays are allocated using a native call (even within the
Java bytecode layer that is), and the escape analysis does not see
beyond any native call. Even if it originates from a Java operation with
well-known semantics (with regards to escape analysis).
Thefore it can't ellide the allocations... :/
Just thinking out loud, I would say it is JVM specific how much the
implementors have improved escape analysis.
--
Paulo