1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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

@@ -2297,6 +2297,7 @@ void EditorHelp::_gen_doc_thread(void *p_udata) {
static bool doc_gen_use_threads = true;
void EditorHelp::generate_doc(bool p_use_cache) {
OS::get_singleton()->benchmark_begin_measure("EditorHelp::generate_doc");
if (doc_gen_use_threads) {
// In case not the first attempt.
_wait_for_thread();
@@ -2327,6 +2328,7 @@ void EditorHelp::generate_doc(bool p_use_cache) {
_gen_doc_thread(nullptr);
}
}
OS::get_singleton()->benchmark_end_measure("EditorHelp::generate_doc");
}
void EditorHelp::_toggle_scripts_pressed() {