Closed Bug 1103441 Opened 8 years ago Closed 8 years ago

Firefox is nearly 10X slower than Chrome when running ActionScript3 V8 benchmarks in Shumway.

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mbx, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: perf)

Attachments

(6 files)

601.24 KB, application/zip
Details
14.70 KB, application/x-shockwave-flash
Details
6.44 KB, application/x-shockwave-flash
Details
7.17 KB, application/x-shockwave-flash
Details
5.00 KB, application/x-shockwave-flash
Details
3.98 KB, application/x-shockwave-flash
Details
Attached file perf.zip
To run the test, un-zip and run:

js build/ts/shell.js -x v8.swf

FF: Richards 357
Chrome: Richards 2994
Safari: Richards 2416

I've only provided a shell test for SpiderMonkey, if needed I can also provide a browser test case.
I did a Gecko Profiler run on an almost-identical browser version:
http://people.mozilla.org/~bgirard/cleopatra/#report=04b86f855e7d929bfca78ee7d7849f147174b5c8

Contains other stuff, too, but the block from ~2850ms to ~4000ms is Richards.

One thing that jumps out is that we spend a lot of time dealing with ICs, and almost 20% of all time under ArgumentsObject::createForIon. Sadly, I can't see the function causing that, but I have a few ideas.
In https://github.com/mozilla/shumway/pull/1881, I removed the Arguments object allocations that showed up in the profile. That improved the score on the above benchmark to about 500, and that in the original v8 benchmark to about 3500 (with Chrome Canary getting 5200 and Safari getting 2700).

I still see lots of time, about 30%, under GetPropertyIC::update: http://people.mozilla.org/~bgirard/cleopatra/#report=80e631226740b397f49fbb2bd4fedc1a29e29934
It looks like our Ion ICs might constantly be using the fallback stub (maybe after filling all the stubs or not).
Depends on: 1104027
Flags: needinfo?(jdemooij)
We spend a ton of time in GetPropertyIC stubs, almost all of that is here:

avm.js:19629:  if (value._isLazyInitializer) {

`value` is polymorphic and we give up attaching new IC stubs :( Also, a third of the VM time here is GetPropertyHelperInline triggering warnings if the property is not found (cx->currentScript is slow for Ion code). We should stop doing that somehow.

If I change that line to

    if (isLazyConstant(value)) {

We're > 8x faster.
Depends on: 1106982
(In reply to Jan de Mooij [:jandem] from comment #4)
> Also, a third of the VM time here is GetPropertyHelperInline triggering warnings if
> the property is not found (cx->currentScript is slow for Ion code). We
> should stop doing that somehow.

Filed bug 1106982. That patch does not really fix the performance problem but it does help a bit.
Attached file crypto.swf
Attached file delta-blue.swf
Attached file ray-trace.swf
Attached file richards.swf
Attached file splay.swf
Depends on: 1107515
Flags: needinfo?(jdemooij)
Depends on: 1108289
Depends on: 1108290
Depends on: 1108411
Depends on: 1108444
Blocks: shumway-fb2
Keywords: perf
Deltablue is the biggest problem now (28x slower) followed by Raytrace (5-6x slower). Raytrace is affected by __proto__ (bug 1108444), will look into Deltablue tomorrow.
Depends on: 1113240
Depends on: 1113643
Depends on: 1114981
Depends on: 1125505
No longer blocks: shumway-fb2
Depends on: 1128535
Depends on: 1129382
Depends on: 1129387
This is well and truly fixed: the last results on awfy before we ripped out the Shumway JIT this was filed for were all substantially better in SpiderMonkey than in V8:
http://arewefastyet.com/#machine=28&view=breakdown&suite=shumway
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.