Yes. It helps (~15% overall improvement), but not as much as manual
scalar replacement in source code has helped.
Erkki
Miles Sabin wrote:
> On Sun, Jun 28, 2009 at 11:26 PM, Erkki Lindpere<
erkki@...> wrote:
>
>> * I think scalar replacement is what it's called -- given the type
>> Vector2(x: Float, y: Float) { /* operations */ }, I want to replace
>> 1) local variables:
>> val v = new Vector2(1f, 2f) --> val v$x = 1f; val v$y = 2f
>> 2) any operations on Vectors with operations on Floats
>> 3) any escaping vectors with new Vector2(v$x, v$y) -- most of the time they
>> will not escape
>>
>> Or should I just wait until JIT can do this better? :)
>>
>
> Before trying to do this by hand, have you tried the
> -XX:+DoEscapeAnalysis option of recent Sun JVMs?
>
> Cheers,
>
>
> Miles
>
>