/wasm-image-operations

Demo Web App with image operations with WebAssembly compiled from Rust, with benchmarks

Primary LanguageJavaScript

Wasm-image-operations

start-node.sh

JS vs Wasm benchmark, when perform the same basic operations on an image's pixels.

Demo

  • The average pixel value (R+G+B) of the image is computed with WebAssembly.
  • A benchmark of JS vs Wasm duration to perform the operations is performed (over multiple iterations) - see below the image.

Run

  1. Install the dependencies:

    $ npm install

  2. Start the demo:

    $(npm bin)/parcel index.html parcel serve index.html --public-url /

  3. Visit http://localhost:1234 with your browser.

Built with Parcel+Rust

Boilerplate used: https://github.com/koute/stdweb/tree/master/examples/hasher-parcel

How does this work?

A parcel plugin is used to integrate cargo-web with Parcel.

Source: https://github.com/koute/stdweb/tree/master/examples/hasher-parcel