Skip to content

ResourceLoader.load_threaded_request use_sub_threads = true causes Editor + Player to hang. #78734

Description

@cosmoddd

Godot version

4.1

System information

Godot v4.1.beta3 - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 31.0.15.3203) - Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 Threads)

Issue description

When I use ResourceLoader.load_threaded_request(_scene, "", true) in 4.0.3 Stable, my set of three scenes loads in about five seconds.

When I use the same command in 4.1b3, to load the same data, the program hangs for roughly 3-5 minutes, or crashes. After spending time troubleshooting, I am left with the impression that the use_sub_threads feature seems to slow down the editor when there are heavier scenes to load.

I tried moving the level loading thread to a new thread group (the new 4.1 feature), but this threw a ton of errors dealing with the level loading being on the wrong thread.

Other things I've done to try to alleviate the issue:

  • clean reimport of .godot project file
  • clean export to standalone build in Windows
  • disabled physics where possible

All to no avail. I'm including a smaller project so you can try to see what's happening during the ResourceLoader.load_threaded_request(level, "", true) command yourself.

I didn't change anything in my project - except upgrade to 4.1.

Possible regression?

Steps to reproduce

Download and extract the project: here

Import the project.

Load in a series of models that test the engine's ability to load a large scene.

Play the scene and notice the load speed timer in the output window.

On line 16 of BaseLevel.gd, compare the editor behavior for
ResourceLoader.load_threaded_request(level, "", true)
to
ResourceLoader.load_threaded_request(level, "", false)

Notice how there's a serious bottleneck when the use_sub_threads setting is set to 'true'.

Minimal reproduction project

Download and extract the project: here

Metadata

Metadata

Assignees

Type

No type

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions