Skip to content

Download speed of editors significantly slower when Godots does not have focus #174

@Haydoggo

Description

@Haydoggo

When downloading an editor version, the progress of the download slows down a lot (maybe >10x?) if the application window loses focus. Download speed resumes to normal speed if focus is regained.

This seems to be the culprit:

func _notification(what: int) -> void:
if NOTIFICATION_APPLICATION_FOCUS_OUT == what:
OS.low_processor_usage_mode_sleep_usec = 100000
elif NOTIFICATION_APPLICATION_FOCUS_IN == what:
OS.low_processor_usage_mode_sleep_usec = ProjectSettings.get(
"application/run/low_processor_mode_sleep_usec"
)

I've played around with the HTTPRequest in a test project, and there's a few ways this could be fixed, but I think the simplest and most effective would be to simply enable the use_threads property on the HTTPRequest node in asset_download.tscn to decouple the download process from the reduced application frame rate, otherwise we can only download one chunk (64kB by default) per 100ms when the window does not have focus

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions