2022-06-25 09:30:26 +08:00
|
|
|
name: benchmark
|
|
|
|
|
2022-06-14 23:48:07 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- "docs/**"
|
|
|
|
- "papers/**"
|
|
|
|
- "rfcs/**"
|
|
|
|
- "*.md"
|
|
|
|
|
|
|
|
jobs:
|
2022-07-05 02:13:07 +08:00
|
|
|
callgrind:
|
2022-06-14 23:48:07 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-05 02:13:07 +08:00
|
|
|
os: [ubuntu-22.04]
|
2022-06-14 23:48:07 +08:00
|
|
|
benchResultsRepo:
|
|
|
|
- { name: "luau-lang/benchmark-data", branch: "main" }
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-06-25 00:46:29 +08:00
|
|
|
- name: Checkout Luau repository
|
2022-06-14 23:48:07 +08:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-06-25 00:46:29 +08:00
|
|
|
- name: Install valgrind
|
|
|
|
run: |
|
2023-09-16 18:21:09 +08:00
|
|
|
sudo apt-get update
|
2022-06-25 00:46:29 +08:00
|
|
|
sudo apt-get install valgrind
|
|
|
|
|
2022-08-12 05:01:33 +08:00
|
|
|
- name: Build Luau (gcc)
|
|
|
|
run: |
|
|
|
|
CXX=g++ make config=profile luau
|
|
|
|
cp luau luau-gcc
|
|
|
|
|
2022-10-18 03:18:34 +08:00
|
|
|
- name: Build Luau (codegen)
|
|
|
|
run: |
|
|
|
|
make config=profile clean
|
|
|
|
CXX=clang++ make config=profile native=1 luau
|
|
|
|
cp luau luau-codegen
|
|
|
|
|
2022-08-12 05:01:33 +08:00
|
|
|
- name: Build Luau (clang)
|
|
|
|
run: |
|
|
|
|
make config=profile clean
|
2023-06-12 23:46:44 +08:00
|
|
|
CXX=clang++ make config=profile luau luau-analyze luau-compile
|
2022-08-12 05:01:33 +08:00
|
|
|
|
|
|
|
- name: Run benchmark (bench-gcc)
|
|
|
|
run: |
|
|
|
|
python bench/bench.py --callgrind --vm "./luau-gcc -O2" | tee -a bench-gcc-output.txt
|
2022-06-25 00:46:29 +08:00
|
|
|
|
2022-08-12 05:14:32 +08:00
|
|
|
- name: Run benchmark (bench)
|
2022-06-25 00:46:29 +08:00
|
|
|
run: |
|
2022-08-12 05:14:32 +08:00
|
|
|
python bench/bench.py --callgrind --vm "./luau -O2" | tee -a bench-output.txt
|
2022-07-05 23:23:09 +08:00
|
|
|
|
2022-10-18 03:18:34 +08:00
|
|
|
- name: Run benchmark (bench-codegen)
|
|
|
|
run: |
|
|
|
|
python bench/bench.py --callgrind --vm "./luau-codegen --codegen -O2" | tee -a bench-codegen-output.txt
|
|
|
|
|
2022-07-05 23:23:09 +08:00
|
|
|
- name: Run benchmark (analyze)
|
|
|
|
run: |
|
|
|
|
filter() {
|
|
|
|
awk '/.*I\s+refs:\s+[0-9,]+/ {gsub(",", "", $4); X=$4} END {print "SUCCESS: '$1' : " X/1e7 "ms +/- 0% on luau-analyze"}'
|
|
|
|
}
|
|
|
|
valgrind --tool=callgrind ./luau-analyze --mode=nonstrict bench/other/LuauPolyfillMap.lua 2>&1 | filter map-nonstrict | tee -a analyze-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-analyze --mode=strict bench/other/LuauPolyfillMap.lua 2>&1 | filter map-strict | tee -a analyze-output.txt
|
2023-03-14 04:58:29 +08:00
|
|
|
valgrind --tool=callgrind ./luau-analyze --mode=strict --fflags=DebugLuauDeferredConstraintResolution bench/other/LuauPolyfillMap.lua 2>&1 | filter map-dcr | tee -a analyze-output.txt
|
2022-07-05 23:23:09 +08:00
|
|
|
valgrind --tool=callgrind ./luau-analyze --mode=nonstrict bench/other/regex.lua 2>&1 | filter regex-nonstrict | tee -a analyze-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-analyze --mode=strict bench/other/regex.lua 2>&1 | filter regex-strict | tee -a analyze-output.txt
|
2023-03-14 04:58:29 +08:00
|
|
|
valgrind --tool=callgrind ./luau-analyze --mode=strict --fflags=DebugLuauDeferredConstraintResolution bench/other/regex.lua 2>&1 | filter regex-dcr | tee -a analyze-output.txt
|
2022-07-05 23:23:09 +08:00
|
|
|
|
|
|
|
- name: Run benchmark (compile)
|
|
|
|
run: |
|
|
|
|
filter() {
|
2023-06-12 23:46:44 +08:00
|
|
|
awk '/.*I\s+refs:\s+[0-9,]+/ {gsub(",", "", $4); X=$4} END {print "SUCCESS: '$1' : " X/1e7 "ms +/- 0% on luau-compile"}'
|
2022-07-05 23:23:09 +08:00
|
|
|
}
|
2023-06-12 23:46:44 +08:00
|
|
|
valgrind --tool=callgrind ./luau-compile --null -O0 bench/other/LuauPolyfillMap.lua 2>&1 | filter map-O0 | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --null -O1 bench/other/LuauPolyfillMap.lua 2>&1 | filter map-O1 | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --null -O2 bench/other/LuauPolyfillMap.lua 2>&1 | filter map-O2 | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --codegennull -O2 bench/other/LuauPolyfillMap.lua 2>&1 | filter map-O2-codegen | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --null -O0 bench/other/regex.lua 2>&1 | filter regex-O0 | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --null -O1 bench/other/regex.lua 2>&1 | filter regex-O1 | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --null -O2 bench/other/regex.lua 2>&1 | filter regex-O2 | tee -a compile-output.txt
|
|
|
|
valgrind --tool=callgrind ./luau-compile --codegennull -O2 bench/other/regex.lua 2>&1 | filter regex-O2-codegen | tee -a compile-output.txt
|
2022-06-25 00:46:29 +08:00
|
|
|
|
2022-07-05 02:13:07 +08:00
|
|
|
- name: Checkout benchmark results
|
2022-06-25 00:46:29 +08:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: ${{ matrix.benchResultsRepo.name }}
|
|
|
|
ref: ${{ matrix.benchResultsRepo.branch }}
|
|
|
|
token: ${{ secrets.BENCH_GITHUB_TOKEN }}
|
|
|
|
path: "./gh-pages"
|
|
|
|
|
2022-08-12 05:14:32 +08:00
|
|
|
- name: Store results (bench)
|
2022-08-12 05:01:33 +08:00
|
|
|
uses: Roblox/rhysd-github-action-benchmark@v-luau
|
|
|
|
with:
|
|
|
|
name: callgrind clang
|
|
|
|
tool: "benchmarkluau"
|
2022-08-12 05:14:32 +08:00
|
|
|
output-file-path: ./bench-output.txt
|
|
|
|
external-data-json-path: ./gh-pages/bench.json
|
2022-08-12 05:01:33 +08:00
|
|
|
|
2022-10-18 03:18:34 +08:00
|
|
|
- name: Store results (bench-codegen)
|
|
|
|
uses: Roblox/rhysd-github-action-benchmark@v-luau
|
|
|
|
with:
|
|
|
|
name: callgrind codegen
|
|
|
|
tool: "benchmarkluau"
|
|
|
|
output-file-path: ./bench-codegen-output.txt
|
|
|
|
external-data-json-path: ./gh-pages/bench-codegen.json
|
|
|
|
|
2022-08-12 05:01:33 +08:00
|
|
|
- name: Store results (bench-gcc)
|
2022-06-25 00:46:29 +08:00
|
|
|
uses: Roblox/rhysd-github-action-benchmark@v-luau
|
|
|
|
with:
|
2022-08-12 05:01:33 +08:00
|
|
|
name: callgrind gcc
|
2022-06-25 00:46:29 +08:00
|
|
|
tool: "benchmarkluau"
|
2022-08-12 05:01:33 +08:00
|
|
|
output-file-path: ./bench-gcc-output.txt
|
|
|
|
external-data-json-path: ./gh-pages/bench-gcc.json
|
2022-07-05 23:23:09 +08:00
|
|
|
|
|
|
|
- name: Store results (analyze)
|
|
|
|
uses: Roblox/rhysd-github-action-benchmark@v-luau
|
|
|
|
with:
|
|
|
|
name: luau-analyze
|
|
|
|
tool: "benchmarkluau"
|
|
|
|
output-file-path: ./analyze-output.txt
|
|
|
|
external-data-json-path: ./gh-pages/analyze.json
|
|
|
|
|
|
|
|
- name: Store results (compile)
|
|
|
|
uses: Roblox/rhysd-github-action-benchmark@v-luau
|
|
|
|
with:
|
2023-06-12 23:46:44 +08:00
|
|
|
name: luau-compile
|
2022-07-05 23:23:09 +08:00
|
|
|
tool: "benchmarkluau"
|
|
|
|
output-file-path: ./compile-output.txt
|
|
|
|
external-data-json-path: ./gh-pages/compile.json
|
2022-06-25 00:46:29 +08:00
|
|
|
|
|
|
|
- name: Push benchmark results
|
|
|
|
if: github.event_name == 'push'
|
2022-06-14 23:48:07 +08:00
|
|
|
run: |
|
|
|
|
echo "Pushing benchmark results..."
|
|
|
|
cd gh-pages
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github@users.noreply.github.com
|
2022-07-05 23:23:09 +08:00
|
|
|
git add *.json
|
2022-06-14 23:48:07 +08:00
|
|
|
git commit -m "Add benchmarks results for ${{ github.sha }}"
|
|
|
|
git push
|
|
|
|
cd ..
|