https://github.com/samsung/walrus
WebAssembly Lightweight RUntime
https://github.com/samsung/walrus
Last synced: over 1 year ago
JSON representation
WebAssembly Lightweight RUntime
- Host: GitHub
- URL: https://github.com/samsung/walrus
- Owner: Samsung
- License: apache-2.0
- Created: 2022-10-05T23:53:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-08T00:58:56.000Z (over 1 year ago)
- Last Synced: 2025-04-08T01:32:33.993Z (over 1 year ago)
- Language: WebAssembly
- Size: 2.82 MB
- Stars: 63
- Watchers: 9
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# WALRUS: WebAssembly Lightweight RUntime
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/Samsung/walrus/actions)
[](https://scan.coverity.com/projects/samsung-walrus)
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:
```console
$ 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](https://cmake.org). You can then run CMake, the normal way:
```console
$ 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](https://perf.wiki.kernel.org/index.php/Main_Page).
0. To compile with perf support, use `-DWALRUS_JITPERF=1`
1. Set the path where temporary files are created with `WALRUS_PERF_DIR` environment variable.
Run Walrus with: `sudo perf record -k 1 walrus --jit WALRUS_PARAMETERS`
The `-k 1` option sets the monotonic clock, `-k mono` is also correct.
Three files are generated:
- perf.data - it is generated by perf
- jit-XXXXXX.dump - The dump of jit generated functions, XXXXXX is the PID of process
- jit-XXXXXX-codedump.txt - Walrus ByteCode dump, XXXXXX is the PID of process
2. You should chown perf.data, because you don't need `sudo` after that.
3. 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`
4. View the report with `perf report -i perf.data.jitted`