noVNC/core/wasm
Joel Martin 82b8ff1c6a wasm: tests/results for 3 modes.
- mode 1: call putImageData from rust/wasm. This involves copying the
  image data via the wasm-bindgen API.
- mode 2: allocating memory in rust/wasm and returning reference to it
  for JS code. JS code calls draw2 using the reference so now image
  data is copying in either direction.
- mode 3: same as mode 2 but the draw3 function treats the memory as
  a vector of u32 instead of a vector of u8.
2018-07-26 14:19:01 +09:00
..
src wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00
Cargo.toml wasm: hello world with rust, wasm-bindgen, webpack 2018-07-25 16:02:40 +09:00
Dockerfile wasm: hello world with rust, wasm-bindgen, webpack 2018-07-25 16:02:40 +09:00
README.md wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00
bootstrap.js wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00
index.html wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00
index.js wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00
package.json wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00
webpack.config.js wasm: tests/results for 3 modes. 2018-07-26 14:19:01 +09:00

README.md

noVNC + wasm

This is a WebAssembly proof-of-concept.

It is based on information from the following sources:

Prep:

docker build -t rust-wasm ./core/wasm

docker run -it -v `pwd`:/novnc -w /novnc/core/wasm -p 8080:8080 rust-wasm bash

npm install

Build:

npm run build-release  # or run build-debug (10x slower code)
npm run serve          # then visit localhost:8080 outside the container

Note that run server will automatically detect modification to index.js and reload the page.

Preliminary results:

  • 2048x1024, draw1, release: 66.7ms

  • 2048x1024, draw2, release: 34.1ms ( 21.7ms / 12.4ms)

  • 2048x1024, draw3, release: 29.9ms ( 15.1ms / 14.8ms)

  • 1024x1024, draw1, release: 47.5ms

  • 1024x1024, draw2, release: 21.8ms ( 12.0ms / 9.8ms)

  • 1024x1024, draw3, release: 16.7ms ( 6.9ms / 9.8ms)

  • 1024x1024, draw1, debug: 376.6ms

  • 1024x1024, draw2, debug: 132.4ms (129.1ms / 3.3ms)

  • 1024x1024, draw3, debug: 131.4ms (128.8ms / 2.6ms)