Boxing, primitives, strict mode (was: Re: [amber-lang] Amber vs. SqueakJS Performance)

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Boxing, primitives, strict mode (was: Re: [amber-lang] Amber vs. SqueakJS Performance)

Herby Vojčík
When we're talking about Amber performance, interesting thing was, that
(while in devel mode), by just adding "use strict"; at the start of
Kernel-Objects.js and Benchfib.js (the two files mostly involved in
running '0 tinyBenchmarks') that score went up from 350k to 550k.

It seems boxing and unboxing primitives, which happens in non-strict
mode, takes its toll here. We should move to "use strict"; by default,
trying to keep primitives unboxed when possible, and have the code that
uses typeof checks to to things as fast as possible while things are in
primitive state and fallback to unboxing (which is hard in general case,
you may get instance of Boolean class from different frame, for example)
code for the non-trivial case.

It would be then needed to run the tests in both "use strict" works and
"use strict" does not work scenarios - I hope node has some option to
switch it off in V8 options.

Bert Freudenberg wrote:

> On 25.01.2015, at 20:47, Herby Vojčík<[hidden email]>  wrote:
>> The big perf hog in Amber is bulding contexts.
> Yep, same in SqueakJS. That's the biggest problem for improving send performance.
>> The problem probably is with creating two functions with outer lexical context set each time.
> Are you saying Amber is creating a new function for every invocation of a method? Wouldn't that mean the JavaScript JIT could never optimize it, because it is thrown away after the first use?
> - Bert -

You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit