[meta] "use asm" should not affect code speed

NEW
Unassigned

Status

()

Core
JavaScript Engine
4 years ago
2 years ago

People

(Reporter: bhackett, Unassigned)

Tracking

(Depends on: 3 bugs)

Other Branch
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
asm.js preserves js semantics, and it in principle seems like the speed enhancements made by OdinMonkey should be applicable to vanilla js given enough engineering effort.  I don't know how much of this is actually feasible to do, but it seems a worthy goal to pursue.  This would improve performance by some amount for code that looks nothing like asm.js, and by a lot for code that is very similar to asm.js but includes unsupported features like property accesses.

Note that this would not affect the frontend performance / memory improvements made by asm.js (overhead from constructing JSScripts / baseline code etc.), just the peak performance reached by generated code.
(Reporter)

Comment 1

4 years ago
Some numbers from experimenting on fannkuch(10) in the emscripten benchmark suite.  This benchmark involves pretty much no calls so is good for isolating the cost of memory accesses and simple integer operations.  Numbers are an x86/darwin post 804676 non-threadsafe build with the script size limit turned off (most of fannkuch is normally only compiled if off thread compilation is available, due to differing script size thresholds).  Pre 804676 seems to behave similarly.

                  lsra  backtracking
asm.js            600   562
trunk             976   875
  w/memops        803   701
  w/o interrupts  789   640

trunk w/memops adds paths to IonBuilder to generate the same MIR nodes as asm.js for memory loads and stores when possible.

trunk w/o interrupts additionally removes code for interrupt checks at loop headers (code which is not required by asm.js).

This still leaves a 30% gap with lsra, and 14% with backtracking.  This looks to be some combination of worse regalloc due to snapshots keeping things alive longer, and just plain more instructions.  Comparing w/o interrupt w/backtracking to asm.js w/backtracking, the former executes 66m (16%) more spill instructions and 234m (11%) more instructions overall.  Needs more investigating.
(Reporter)

Updated

4 years ago
Depends on: 864214
(Reporter)

Updated

4 years ago
Depends on: 864216
(Reporter)

Updated

4 years ago
Depends on: 864218
(Reporter)

Updated

4 years ago
Depends on: 864220
(Reporter)

Updated

4 years ago
Depends on: 865889
(Reporter)

Updated

4 years ago
Depends on: 866670
(Reporter)

Updated

4 years ago
Depends on: 870052
(Reporter)

Updated

4 years ago
Depends on: 870821
(Reporter)

Updated

4 years ago
Depends on: 870847
(Reporter)

Updated

4 years ago
Depends on: 871002
(Reporter)

Updated

4 years ago
Depends on: 886957
(Reporter)

Updated

4 years ago
Depends on: 886960
(Reporter)

Updated

4 years ago
Depends on: 891400
(Reporter)

Updated

4 years ago
Depends on: 891534
(Reporter)

Updated

4 years ago
Depends on: 898021
(Reporter)

Updated

4 years ago
Depends on: 898486
(Reporter)

Updated

4 years ago
Depends on: 902009
(Reporter)

Updated

4 years ago
Depends on: 902508
Depends on: 932767
(Reporter)

Updated

3 years ago
Depends on: 1019188
(Reporter)

Updated

3 years ago
Depends on: 1028580
(Assignee)

Updated

3 years ago
Assignee: general → nobody
Depends on: 1143758
(Reporter)

Updated

2 years ago
Depends on: 1177139
You need to log in before you can comment on or make changes to this bug.