godot-xterm/benchmark/editor_launch.sh
Leroy Hopson 9569c9e489 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/.
2024-06-09 21:21:30 +12:00

24 lines
488 B
Bash
Executable file

#!/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