Investigate why V8 is faster than TM on empty loop

RESOLVED DUPLICATE of bug 501189

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 501189
8 years ago
8 years ago

People

(Reporter: cdleary, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Inquiry stemming from http://ugh.cc/ubench-ironjs-f-jit-vs-v8-vs-tracemonkey/

When the empty loop is placed in the global scope TM is faster:

$ bench_shells.py 'for (var i = 0; i < 10000000; ++i);' --global-scope
Run count:  50
v8: 89.22      (+/- 3.34)
tm: 32.36      (+/- 7.27)

But in a benchmark-function scope V8 is faster:

$ bench_shells.py 'for (var i = 0; i < 10000000; ++i);'
Run count:  50
v8: 23.2       (+/- 1.28)
tm: 30.46      (+/- 0.70)

(Bench shells is just a little shortcut script I wrote: http://gist.github.com/379010 )
Forgot to mention: bleeding edge V8 x64 rev 4486, TM x64 rev 41264.

Comment 2

8 years ago
dmandelin looked into empty loops before. Basically this is caused by a lack of register allocation across the loop edge and the operationCallback check at the loop end. Both effects become much less relevant for non-empty loops, or the "real world", as one might also call it.
(In reply to comment #2)

I see that now: bug 501189 and attachment 390586 [details].

Auxiliary reference: https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_SetOperationCallback#section_3

Marking as dup.
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 501189
You need to log in before you can comment on or make changes to this bug.