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

set background = TRUE procs are extremely slow #1262

Open
out-of-phaze opened this issue May 25, 2023 · 2 comments · May be fixed by #1539
Open

set background = TRUE procs are extremely slow #1262

out-of-phaze opened this issue May 25, 2023 · 2 comments · May be fixed by #1539
Labels
Runtime Involves the OpenDream server/runtime

Comments

@out-of-phaze
Copy link
Contributor

out-of-phaze commented May 25, 2023

Using set background = TRUE in setup_atmos_machinery() on Nebula adds 151 seconds to Ministation init.

/datum/controller/subsystem/machines/proc/setup_atmos_machinery(list/machines)
	set background=1

	report_progress("Initializing atmos machinery")
	for(var/obj/machinery/atmospherics/A in machines)
		A.atmos_init()
		CHECK_TICK

	report_progress("Initializing pipe networks")
	for(var/obj/machinery/atmospherics/machine in machines)
		machine.build_network()
		CHECK_TICK

169 second Ministation init with the above, even if you replace the contents of the loops with a no-op. Removing set background = TRUE from this one proc makes all of init take 28 seconds.

@wixoaGit wixoaGit added the Runtime Involves the OpenDream server/runtime label May 26, 2023
@wixoaGit
Copy link
Member

This is because of the implicit sleep(-1) that gets inserted at the end of every loop when a proc has set background = TRUE. In BYOND a sleep delay of -1 will only yield if there are other backlogged tasks, but in OD it will always yield.

@amylizzle
Copy link
Contributor

This is also significantly affecting goon now too, due to some recent speed-ups in world init ironically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Runtime Involves the OpenDream server/runtime
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants