summaryrefslogtreecommitdiffstats
path: root/scene/register_scene_types.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-12-08 12:52:49 +0100
committerYuri Sizov <yuris@humnom.net>2023-12-08 12:53:04 +0100
commitfc3f40f37d24090d6de4e45190ea2c7df3a27179 (patch)
treee9defb0ceebb684862d43003d0e598486c89941a /scene/register_scene_types.cpp
parentd5ad37afcd44f4ba953e3473b5ab3afb18068134 (diff)
downloadredot-engine-fc3f40f37d24090d6de4e45190ea2c7df3a27179.tar.gz
Improve engine startup/shutdown benchmarks
- Add contexts to give a better sense of benchmarked areas. - Add missing benchmarks and adjust some begin/end points. - Clean up names. - Improve Android's internal benchmarks in a similar manner. Co-authored-by: Fredia Huya-Kouadio <fhuya@meta.com>
Diffstat (limited to 'scene/register_scene_types.cpp')
-rw-r--r--scene/register_scene_types.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 3727c788fd..2e6759063b 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -293,6 +293,8 @@ static Ref<ResourceFormatSaverShaderInclude> resource_saver_shader_include;
static Ref<ResourceFormatLoaderShaderInclude> resource_loader_shader_include;
void register_scene_types() {
+ OS::get_singleton()->benchmark_begin_measure("Scene", "Register Types");
+
SceneStringNames::create();
OS::get_singleton()->yield(); // may take time to init
@@ -1182,9 +1184,13 @@ void register_scene_types() {
}
SceneDebugger::initialize();
+
+ OS::get_singleton()->benchmark_end_measure("Scene", "Register Types");
}
void unregister_scene_types() {
+ OS::get_singleton()->benchmark_begin_measure("Scene", "Unregister Types");
+
SceneDebugger::deinitialize();
ResourceLoader::remove_resource_format_loader(resource_loader_texture_layered);
@@ -1227,10 +1233,16 @@ void unregister_scene_types() {
CanvasItemMaterial::finish_shaders();
ColorPicker::finish_shaders();
SceneStringNames::free();
+
+ OS::get_singleton()->benchmark_end_measure("Scene", "Unregister Types");
}
void register_scene_singletons() {
+ OS::get_singleton()->benchmark_begin_measure("Scene", "Register Singletons");
+
GDREGISTER_CLASS(ThemeDB);
Engine::get_singleton()->add_singleton(Engine::Singleton("ThemeDB", ThemeDB::get_singleton()));
+
+ OS::get_singleton()->benchmark_end_measure("Scene", "Register Singletons");
}