Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Why Wasm+WASI for Scala

Rikito Taniguchi
December 17, 2024
57

Why Wasm+WASI for Scala

社内発表で軽く話した/Scalaわいわい勉強会#4で話そうと思っていたスライド

Rikito Taniguchi

December 17, 2024
Tweet

Transcript

  1. 4 Is Wasm faster than JS? Wasm is indeed designed

    to be executed efficiently, but asking whether Wasm is faster than JavaScript is fundamentally a flawed question. Essentially, it depends on whether the compiler generates efficient JS or Wasm code, what kind of workload is, and on the implementation of the VM. Therefore, the accurate answer is that Wasm has the potential to be faster than JS, but whether it is generally faster depends on the implementation and workloads. Potentially yes, but it depends Long answer:
  2. 5 Is Wasm faster than JS? Potential future optimizations: -

    Optimization by wasm-opt - Remove unnecessary JS-interop
  3. 7 Wasm is about new features on browser And green-threads

    with stack-switching proposal in future Based on JSPI Wasm proposal
  4. 8 server-side Wasm is about sandboxing and fast-startup (and polyglot)

    Cloud is about sharing resources with other people on the large computers. Safe and efficient runtime isolation/virtualization is the key
  5. 9 History of isolation on Cloud • VM (AWS EC2

    / Google Compute Engine) • VMM (Firecracker in AWS Lambda) • Docker (runC?) • gVisor (Cloud Run v1) • Kata container • V8 isolate (Cloudflare workers) • WebAssembly
  6. 10 Li, Guoqing, et al. "Comparative Performance Study of Lightweight

    Hypervisors Used in Container Environment." CLOSER. 2021. gVisor-ptrace has better startup time, but it’s still around ~0.8s (and intercepting syscall reduces syscall latency)