Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: takes too much time to load singleton #1

Closed
wants to merge 1 commit into from

Conversation

Ark2000
Copy link

@Ark2000 Ark2000 commented May 20, 2023

	# Enable required time measurements to display CPU/GPU frame time information.
	RenderingServer.viewport_set_measure_render_time(get_viewport().get_viewport_rid(), true)
	update_information_label()
	update_settings_label()

the above code is very time consuming which will block the main thread and increase startup time by about three to four seconds, so I put them in a separate thread to avoid the block.

@Calinou
Copy link
Member

Calinou commented May 20, 2023

I'll test this locally when I get home.

In my experience, the biggest culprit by far is getting the graphics driver version, which is very slow for some reason. I suggest using a C++ profiler on a debug build of the engine to determine why.

@myaaaaaaaaa Do you know a better way to do this?

@Calinou Calinou added the bug label May 20, 2023
@myaaaaaaaaa
Copy link

I generally diagnose performance problems like these using very advanced techniques such as putting printf(timestamp)s everywhere, commenting out lines of code until something changes, or Ctrl+C-ing in gdb once it reaches time-consuming code so that backtraces show likely culprits 🙃

@Calinou
Copy link
Member

Calinou commented May 20, 2023

Merged manually with c7f463b, which also displays loading text and prevents a warning from being printed by calling wait_to_finish() on the thread instance.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants