More on C++ stack arrays

Bruno Medeiros brunodomedeiros+dng at gmail.com
Tue Oct 22 05:26:02 PDT 2013


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... :/

-- 
Bruno Medeiros - Software Engineer


More information about the Digitalmars-d mailing list