Improve startup benchmarking

Move the benchmarking measuring methods from `Engine` to `OS` to allow for platform specific overrides (e.g: can be used to hook into platform specific benchmarking and tracing capabilities).
This commit is contained in:
Fredia Huya-Kouadio
2023-01-13 11:24:12 -08:00
parent f581f21dd6
commit 831b4a5366
26 changed files with 386 additions and 129 deletions

View File

@@ -88,6 +88,6 @@ _arguments \
'--build-solutions[build the scripting solutions (e.g. for C# projects)]' \
'--dump-gdextension-interface[generate GDExtension header file 'gdextension_interface.h' in the current folder. This file is the base file required to implement a GDExtension.]' \
'--dump-extension-api[generate JSON dump of the Godot API for GDExtension bindings named "extension_api.json" in the current folder]' \
'--startup-benchmark[benchmark the startup time and print it to console]' \
'--startup-benchmark-file[benchmark the startup time and save it to a given file in JSON format]:path to output JSON file' \
'--benchmark[benchmark the run time and print it to console]' \
'--benchmark-file[benchmark the run time and save it to a given file in JSON format]:path to output JSON file' \
'--test[run all unit tests; run with "--test --help" for more information]'

View File

@@ -91,8 +91,8 @@ _complete_godot_options() {
--build-solutions
--dump-gdextension-interface
--dump-extension-api
--startup-benchmark
--startup-benchmark-file
--benchmark
--benchmark-file
--test
" -- "$1"))
}

View File

@@ -109,6 +109,6 @@ complete -c godot -l no-docbase -d "Disallow dumping the base types (used with -
complete -c godot -l build-solutions -d "Build the scripting solutions (e.g. for C# projects)"
complete -c godot -l dump-gdextension-interface -d "Generate GDExtension header file 'gdextension_interface.h' in the current folder. This file is the base file required to implement a GDExtension"
complete -c godot -l dump-extension-api -d "Generate JSON dump of the Godot API for GDExtension bindings named 'extension_api.json' in the current folder"
complete -c godot -l startup-benchmark -d "Benchmark the startup time and print it to console"
complete -c godot -l startup-benchmark-file -d "Benchmark the startup time and save it to a given file in JSON format" -x
complete -c godot -l benchmark -d "Benchmark the run time and print it to console"
complete -c godot -l benchmark-file -d "Benchmark the run time and save it to a given file in JSON format" -x
complete -c godot -l test -d "Run all unit tests; run with '--test --help' for more information" -x