Why -opt 1 and not earlier?

Working on the resolution of the invalid primitive prototype bug when
multiple scopes are involved, I come to the conclusion that *all*
primitives have to be wrapped in some Scriptable to allow to save scope
information (and then unwrapped for some usage). In the case of Number
with this strategy, the "wrapper" could save int and short values
directly without to go through double. No optimization phase would be
required here and it could be used even in interpreted mode.

This being said, I wouldn't necessarily use Rhino (or an other dynamic
language to run numerical algorithm) but I agree that it can be
interesting to detect some performance issues.

Cheers,
Marc.
-- 
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com

Attila Szegedi wrote:
> So, last week at the JVM Language Summit, Cliff Click gave a
> presentation about performance characteristics of various dynamic
> languages on the JVM. (Can't link his presentation in, as the summit
> Wiki is temporarily down...) He was specifically running numerical
> algorithms and watching how they look like after they're bytecode
> compiled, and then JITted all the way down to machine code.
> 
> For Rhino, he said it suffers of "Death by Double" -- all numeric
> operations run on java.lang.Double objects.
> I said "well, there's a command line switch -opt 1 that'll turn on
> various optimizations, among others, the ability to Java primitive
> values when the optimizer can figure out it's safe".
> He asks: "so, it changes the semantics of runtime, right?"
> I start replying: "It doesn't change sem..."
> At which point I'm cut off with: "Then why is it not on by default?"
> 
> Well, touché.
> 
> So, indeed, why is it not on by default? Is it known that it changes
> runtime behavior, or are we just not sure that it doesn't?
> 
> Attila.
> 
> -- 
> home: http://www.szegedi.org
> weblog: http://constc.blogspot.com
> twitter: http://www.twitter.com/szegedi

_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to