12
Not So Fast: Analyzing the Performance of WebAssembly vs. Native Code Abhinav Jangda, Bobby Powers, Emery Berger, Arjun Guha University of Massachusetts Amherst

Not So Fast - USENIX · Analyzing the Performance of WebAssembly vs. Native Code ... Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. Bringing the web up to speed

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Not So Fast: Analyzing the Performance of WebAssembly

vs. Native Code

Abhinav Jangda, Bobby Powers, Emery Berger, Arjun GuhaUniversity of Massachusetts Amherst

WebAssembly

2Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. Bringing the web up to speed with WebAssembly. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2017.

WebAssembly is becoming popular

3

Is WebAssembly fast?

WebAssembly is 17% faster than asm.js4

WebAssembly evaluation on PolyBenchC Benchmarks (Haas et al. PLDI 2017)

WebAssembly is 26% slower than native

Image/Video ProcessingCompilers, debuggers,interpreters, and virtual machines

POSIX Applications

PolyBenchC Benchmarks are not representative of WebAssembly use cases

5

PolyBenchC benchmarks are scientific kernels

Scientific Applications

SPEC CPU benchmarks are better representative of WebAssembly use cases

1. 433.milc2. 444.namd3. 447.dealII4. 450.soplex5. 470.lbm6. 644.nab_s7. 429.mcf8. 462.libquantum

1. 464.h264ref2. 453.povray

1. 400.perlbench2. 403.gcc

1. 401.bzip22. 429.mcf3. 433.milc4. 444.namd5. 445.gobmk6. 450.soplex7. 453.povray8. 458.sjeng9. 462.libquantum

10. 470.lbm11. 473.astar12. 482.sphinx313. 631.leela_s14. 641.nab_s 6

Cannot execute SPEC benchmarks in browsers

System Calls and Filesystem

Browser

No system call support for Web Applications

7

Browsix-WASM provides system calls for WebAssembly apps

Browsix-WASM

Shared Filesystem

Pipes Sockets

system ca

lls

8

Browsix-WASM overhead is minimal

9

Maximum overhead is 1.1%.

Average overhead is 0.2%.

Performance of SPEC benchmarks in WebAssembly

10WebAssembly: 55% slower than nativeWebAssembly: 30% faster than asm.js

Why is there a gap?

11

Per

form

ance

100%

the

gap 1. Poor register allocation

2. Reserved registers3. Poor instruction selection4. Stack overflow checks5. Indirect function call

checks

the

gap

65%70%

Not So Fast: Analyzing the Performance of WebAssembly

vs. Native Code

Abhinav Jangda, Bobby Powers, Emery Berger, Arjun GuhaUniversity of Massachusetts Amherst

ATC 2019Wednesday, July 10

12:20 - 12:40 PM in Runtime Track