Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Bench Wardite

on:
push:
branches:
- main

pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.3.9'
- '3.4.5'
wasm_tools:
- '1.236.0'
hyperfine:
- '1.19.0'

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install wasm-tools
run: |
mkdir -p $HOME/.bin
curl -L https://github.com/bytecodealliance/wasm-tools/releases/download/v${{ matrix.wasm_tools }}/wasm-tools-${{ matrix.wasm_tools }}-x86_64-linux.tar.gz -o wasm-tools.tar.gz
tar xvzf wasm-tools.tar.gz
mv wasm-tools-*-x86_64-linux/wasm-tools $HOME/.bin/wasm-tools
chmod a+x $HOME/.bin/wasm-tools
echo "$HOME/.bin" >> $GITHUB_PATH
- name: Install Hyperfine
run: |
HYPERFINE_VERSION="${{ matrix.hyperfine }}"
curl -LO "https://github.com/sharkdp/hyperfine/releases/download/v${HYPERFINE_VERSION}/hyperfine-v${HYPERFINE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
tar xzf "hyperfine-v${HYPERFINE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
mkdir -p $HOME/.bin
mv "hyperfine-v${HYPERFINE_VERSION}-x86_64-unknown-linux-gnu/hyperfine" $HOME/.bin/hyperfine
chmod a+x $HOME/.bin/hyperfine
- name: Version wasm-tools
run: |
wasm-tools --version
- name: Version Hyperfine
run: |
hyperfine --version
- name: Run the bench task
run: |
bundle exec rake basic_benchmark
20 changes: 8 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ruby
name: Test Wardite

on:
push:
Expand Down Expand Up @@ -30,35 +30,31 @@ jobs:
bundler-cache: true
- name: Install wasm-tools
run: |
mkdir -p .bin
mkdir -p $HOME/.bin
curl -L https://github.com/bytecodealliance/wasm-tools/releases/download/v${{ matrix.wasm_tools }}/wasm-tools-${{ matrix.wasm_tools }}-x86_64-linux.tar.gz -o wasm-tools.tar.gz
tar xvzf wasm-tools.tar.gz
mv wasm-tools-*-x86_64-linux/wasm-tools .bin/wasm-tools
chmod a+x .bin/wasm-tools
mv wasm-tools-*-x86_64-linux/wasm-tools $HOME/.bin/wasm-tools
chmod a+x $HOME/.bin/wasm-tools
echo "$HOME/.bin" >> $GITHUB_PATH
- name: Version wasm-tools
run: |
export PATH=`pwd`/.bin:$PATH
wasm-tools --version
- name: Install wast2json
run: |
mkdir -p .bin
mkdir -p $HOME/.bin
curl -L https://github.com/WebAssembly/wabt/releases/download/${{ matrix.wabt }}/wabt-${{ matrix.wabt }}-ubuntu-20.04.tar.gz -o wabt.tar.gz
tar xvzf wabt.tar.gz
mv wabt-*/bin/wast2json .bin/wast2json
chmod a+x .bin/wast2json
mv wabt-*/bin/wast2json $HOME/.bin/wast2json
chmod a+x $HOME/.bin/wast2json
- name: Version wast2json
run: |
export PATH=`pwd`/.bin:$PATH
wast2json --version
- name: Run the check task
run: |
export PATH=`pwd`/.bin:$PATH
bundle exec rake check
- name: Run the test task
run: |
export PATH=`pwd`/.bin:$PATH
bundle exec rake test
- name: Run the official spec
run: |
export PATH=`pwd`/.bin:$PATH
bundle exec rake 'spec[i32]'
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ task :spec, [:name] do |t, args|
end
end

desc "Run basic benchmark"
task :basic_benchmark do
sh "wasm-tools parse examples/i32_bench.wat -o examples/i32_bench.wasm"
sh "hyperfine --warmup 3 'bundle exec wardite --yjit --no-wasi --invoke detailed_arithmetic_loop examples/i32_bench.wasm'"
end

desc "Generate codes"
task :generate do
require_relative "scripts/gen_alu"
Expand Down
Loading