perf(term): add benchmarks

Adds benchmarks by running [alacritty/vtebench](https://github.com/alacritty/vtebench)
benchmarks in the terminal.
Uses code based on [godotengine/godot-benchmarks](https://github.com/godotengine/godot-benchmarks)
to measure average GPU and CPU time spent per frame.
Uses [github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark)
for continuous integration, and publishes benchmark results to https://lihop.github.io/godot-xterm/dev/bench/.
This commit is contained in:
Leroy Hopson 2024-06-09 17:18:58 +12:00 committed by Leroy Hopson
parent 8b33818751
commit 9569c9e489
10 changed files with 326 additions and 0 deletions

24
benchmark/editor_launch.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e
godot=${1:-godot}
if ! command -v $godot &> /dev/null; then
echo "Error: '$godot' command not found. Please provide a valid path to the Godot executable."
exit 1
fi
results_file=benchmark/results/editor_launch.json
value=$({ time -p $godot --editor --quit; } 2>&1 | tail -n3 | head -n1 | cut -d' ' -f2)
cat <<EOF > $results_file
[
{
"name": "editor_launch",
"unit": "seconds",
"value": $value
}
]
EOF
cat $results_file