Skip to content

Differential Testing of Wasm Runtime Performance with python

Notifications You must be signed in to change notification settings

thinkerhui/WarpDiff-py

 
 

Repository files navigation

WarpDiff-py: Differential Testing of Wasm Runtime Performance with py2wasm

this project is based on WarpDiff

Usage

Step 0: Environment and Data Preparation

  • Runtime Installation: Install Wasm runtimes on your local environment for testing, including Wasmer, Wasmtime, Wasm3, WasmEdge, and WAMR.
  • Programming Language: Python 3.11 (must!)
  • Dataset: pybenchmarks

Step 1: Test Case Compilation

# download pybenchmarks
git clone https://github.com/dundee/pybenchmarks
# install py2wasm
pip install py2wasm
# pybenchmarks dependency
pip install jinja2 gmpy2 numpy
# if needed
sudo apt install patchelf

Adjust BENCHMARK_DIR of compile_to_target_pywasm.py based on your path of pybenchmarks.

You can also adjust TARGET_DIR to change the path you want to save the wasm target.

Then, run :

python3 compile_to_target_pywasm.py

Step 2: Runtime Performance Profiling

pip install numpy func_timeout

To obtain the total running time:

python3 runtime_profiling_total_pywasm.py

You may change PROFILINGDATA_DIR

Step 3: Differential Testing on Runtime Performance Data

pip install scikit-learn pandas
python3 analyze_performance_pywasm.py

You may change PROFILINGDATA_DIR

About

Differential Testing of Wasm Runtime Performance with python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%