Closed Bug 1814841 Opened 3 years ago Closed 2 years ago

WebAssembly [dosbox-x] with exception-handling terrible performace comparing to other browsers

Categories

(Core :: JavaScript: WebAssembly, defect, P3)

Firefox 109
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: caiiiycuk, Unassigned)

Details

Attachments

(2 files)

Attached file ff-dosbox-x-perf.zip

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0

Steps to reproduce:

Hi, I am author a js-dos project. I am ported dosbox-x to web assembly, it's core uses exception-handling feature of webassembly. To estimate performance I have a test dos program that I run inside emulator. This test reports an a VAX number.
I attached the zip with test page. Just press "Start direct" or "Start in worker" to start test. After some amount of time (like 20-30sec) test will print the report, like this:

0: 80000 runs, browser time 1275.300000 ms, VAX rating 35.703095
0: sleep p/sec 58 , avg cycles p/ms: 32030

"VAX" - is a test result, and "avg cycles p/ms" - how many emulation cycles did the browser perform.

Actual results:

When I run this test on FF 109, 110.0b8, the performance is really terrible, like
VAX - 0.14, avg cycles p/ms - 113
Evenmore from time to time "unreachable executed" is throwed (should not happen!)

Expected results:

On same PC results for other browsers:
Chrome:
VAX - ~35, avg cycles p/ms ~32000
Safari:
VAX - ~20, avg cycles p/ms ~19000

If I run simmilar core without eh, the results for firefox is VAX 50-70, so I am guessing that it's related to exception handling feature.

Component: Untriaged → JavaScript: WebAssembly
Product: Firefox → Core

The severity field is not set for this bug.
:rhunt, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(rhunt)
Severity: -- → S2
Flags: needinfo?(rhunt)
Priority: -- → P3
Attached file Profiling file

Profile captured on Linux x86 and Firefox 110.0.

I can reproduce on Linux x86_64 and Firefox 110. I had to run a local http server to test this page.

With Firefox:

0: 10000 runs, browser time 10673.000000 ms, VAX rating 0.533263
0: sleep p/sec 61 , avg cycles p/ms: 411

0: 10000 runs, browser time 9601.000000 ms, VAX rating 0.592805
0: sleep p/sec 62 , avg cycles p/ms: 425

With Chrome:

0: 10000 runs, browser time 720.900000 ms, VAX rating 7.895020
0: sleep p/sec 63 , avg cycles p/ms: 3360

A profile is attached for the firefox run.

After applying patch from bug 1837686, the results are about the same between FF and Chrome.

Resolving as fixed from bug 1837686.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: