Some array benchmarks faster without TI and/or IonMonkey (and always much slower than the competition)




8 years ago
5 years ago


(Reporter: azakai, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [js:t] [js:perf])


(1 attachment)



8 years ago
In the tiny attached benchmark, which focuses on array reads&writes, using typed arrays does not speed things up and in fact slows things down a bit. This is due to the methodjit (tracejit on the other hand does well - typed arrays are faster). This seems odd to me since I would expect such a benchmark to benefit from typed arrays.

Run the benchmark with argument 0 for no typed arrays, argument 1 for typed arrays. My results:

-m typed:         1.88 secs
-m untyped:       1.84
-m -j -p typed:   1.88 (see also bug 612019)
-m -j -p untyped: 1.84
-j typed:         1.04
-j untyped:       1.47

v8 untyped:       3.04

So spidermonkey does well, generally speaking. But I am curious as to why typed arrays do not help here, and worse, why they actually make the methodjit slightly slower.


8 years ago
Depends on: 594247

Comment 1

8 years ago
Forgot to say, the reason I ran into this is that I see the exact same problem with lots of code compiled using Emscripten. It is not specific to the attached benchmark.
I suspect it's because of the extra indirections required, there are definitely improvements to be made. (Bug 650657.)
patches from 656519 solve some of the indirections in bug 650657. Still significant differences between with/without method JIT.
Running the benchmark after applying patches from bug 656519 gives these numbers:

-m typed:       1.076   secs
-m untyped:       1.054
-m -j -p typed:    1.081
-m -j -p untyped: 1.07
-j typed:         0.442
-j untyped:    0.498
With mjit gone, lets morph this bug - it's still relevant, sadly:

(ignoring the typed-or-normal-arrays thing, as typed arrays are slightly faster but otherwise exhibit the same patterns).

js:            1.507 secs
js --no-ti:    1.397 secs
js --no-ion:   1.394 secs

jsc:           0.451 secs
d8:            0.657 secs
Summary: MethodJIT typed arrays slightly slower than normal arrays in some benchmarks → Some array benchmarks faster without TI and/or IonMonkey (and always much slower than the competition)
Whiteboard: [js:t] [js:perf]
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.