Skip to content

Samsung/walrus

Repository files navigation

WALRUS: WebAssembly Lightweight RUntime

License Actions Status Coverity Scan Build Status

This project aims to provide a lightweight WebAssembly runtime engine. It now fully supports WebAssembly specs with an simple interpreter, but we plan to optimize interpreting as well as adopting JIT compiler for better performance.

Cloning

Clone as normal, but don't forget to get the submodules as well:

$ git clone --recursive https://github.com/Samsung/walrus
$ cd walrus
$ git submodule update --init

This will fetch the testsuite and gtest repos, which are needed for some tests.

Building using CMake

You'll need CMake. You can then run CMake, the normal way:

$ cmake -H. -Bout/release/x64 -DWALRUS_ARCH=x64 -DWALRUS_HOST=linux -DWALRUS_MODE=release -DWALRUS_OUTPUT=shell -GNinja
$ ninja -Cout/release/x64
$ ./out/release/x64/walrus test.wasm // run walrus executable

This will produce build files using CMake's default build generator. Read the CMake documentation for more information.

Perf

You'll need Perf.

  1. To compile with perf support, use -DWALRUS_JITPERF=1

  2. Run Walrus with: sudo perf record -k 1 walrus --jit --perf WALRUS_PARAMETERS

    It'll generates 2 files:

    • perf.data - it is generated by perf
    • jit-XXXXXX.dump - JITDump file, XXXXXX is the PID of process, and it contains details of jitted functions
  3. You should chown these 2 files, because you don't need sudo after that.

  4. Inject JITDump file into perf.data with perf inject --jit -i perf.data -o perf.data.jitted

    It'll generate many shared object files, and perf.data.jitted

  5. View the report with perf report -i perf.data.jitted