Files
extism/kernel/build.sh
zach 6f4b43bedc feat: add benchmarking, optimize bounds checking in the kernel (#505)
- Adds benchmarking, run with `cargo bench` or `cargo criterion`
- Adds `MemoryRoot::pointer_in_bounds_fast` to do less precise bounds
checking in loads/stores

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: zshipko <zshipko@users.noreply.github.com>
2023-10-12 13:24:34 -07:00

23 lines
615 B
Bash
Executable File

#!/usr/bin/env bash
export CARGO_FLAGS=""
while getopts d flag
do
case "${flag}" in
d)
echo "Disabled bounds-checking";
export CARGO_FLAGS="--no-default-features";;
*)
echo "usage $0 [-d]"
echo "\t-d: build with bounds checking disabled"
exit 1
esac
done
cargo build --package extism-runtime-kernel --bin extism-runtime --release --target wasm32-unknown-unknown $CARGO_FLAGS
cp target/wasm32-unknown-unknown/release/extism-runtime.wasm .
wasm-strip extism-runtime.wasm
mv extism-runtime.wasm ../runtime/src/extism-runtime.wasm