Skip to content

Commit d982413

Browse files
authored
Add performance tests (#72)
* Tweak Makefiles so it hopefully works with the perf-tests branch * empty commit * Add perf testing * Change threshold calculation to account for vastly different benchmark times * Update after review * mv perf-tester ci/perf-tester * ag didn’t search dotfiles * Run all the benchmarks twice * Add missing import * Cleanup * Delete package-lock.json * Add license
1 parent 76bbe70 commit d982413

File tree

7 files changed

+864
-2
lines changed

7 files changed

+864
-2
lines changed

.github/workflows/perf.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Performance
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
perf:
7+
runs-on: Ubuntu-18.04
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@master
11+
with:
12+
fetch-depth: 1
13+
- name: Run Benchmark
14+
run: |
15+
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv
16+
export SWIFTENV_ROOT="$HOME/.swiftenv"
17+
export PATH="$SWIFTENV_ROOT/bin:$PATH"
18+
eval "$(swiftenv init -)"
19+
swiftenv install $TOOLCHAIN_DOWNLOAD
20+
make perf-tester
21+
node ci/perf-tester
22+
env:
23+
TOOLCHAIN_DOWNLOAD: https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.3-SNAPSHOT-2020-08-10-a/swift-wasm-5.3-SNAPSHOT-2020-08-10-a-linux.tar.gz
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

IntegrationTests/Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ node_modules: package-lock.json
1818
build_rt: node_modules
1919
cd .. && npm run build
2020

21-
.PHONY: benchmark
22-
benchmark: build_rt dist/BenchmarkTests.wasm
21+
.PHONY: benchmark_setup
22+
benchmark_setup: build_rt dist/BenchmarkTests.wasm
23+
24+
.PHONY: run_benchmark
25+
run_benchmark:
2326
node bin/benchmark-tests.js
2427

28+
.PHONY: benchmark
29+
benchmark: benchmark_setup run_benchmark
30+
2531
.PHONY: test
2632
test: build_rt dist/PrimaryTests.wasm
2733
node bin/primary-tests.js

Makefile

+11
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ test:
1515
CONFIGURATION=debug make test && \
1616
CONFIGURATION=release make test
1717

18+
.PHONY: benchmark_setup
19+
benchmark_setup:
20+
cd IntegrationTests && make benchmark_setup
21+
22+
.PHONY: run_benchmark
23+
run_benchmark:
24+
cd IntegrationTests && make -s run_benchmark
25+
26+
.PHONY: perf-tester
27+
perf-tester:
28+
cd ci/perf-tester && npm install

0 commit comments

Comments
 (0)