-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 accessing UID before first scan #102513
base: master
Are you sure you want to change the base?
Fix accessing UID before first scan #102513
Conversation
For what it's worth, when testing this PR on a real-world project with thousands of resource files, I'm not seeing any noticeable regression in pure wall time when deleting |
I did some tests this morning, and below are the added loading times for the editor when the UID cache is missing, and a UID is required before the first scan (e.g.,
One way to improve this could be to avoid scanning the entire project when looking up a single UID and instead stop as soon as it is found. However, the challenge and potential drawback of this approach is that if multiple UIDs are needed, multiple rescans may be required. That's why I suggest scanning everything. Technically, this "scan for UIDs" should not happen often, except in CI/CD environments where the UID cache will always be missing. |
Right, yeah, the "real-world project" in question was definitely closer to 3k than 60k. A second here or there wasn't really what I was looking out for. :) |
281cbdd
to
749b57c
Compare
Fixes the issues. Tested with my big project and the scan was not noticeable. I tested by deleting However there is one error remaining - if your splash screen path is stored as UID, you will still get an error about unrecognized UID. |
749b57c
to
2ed5415
Compare
Thanks for the review and testing. Fixing the boot splash screen will be a bit trickier. The problem is that the logo is loaded before the resources format importers are loaded. If I move Since the issue is not supposed to happen that often, I did a little check before calling The alternative could be to display the boot logo later in the start sequence or put the loading of the |
Yeah, removing errors is enough. |
Really sorry about that, I went too fast! Tested correctly this time! |
2ed5415
to
1b6a0d8
Compare
1b6a0d8
to
9457666
Compare
Default Environment
setting is reset after the "cold" project loading (res://
|uid://
issue) #100915This PR should fix most of the issues where Godot tries to access an UID before the first scan is done and when the UID cache is missing, incomplete or invalid.
The idea is to execute a scan for UIDs on startup if an UID is used before the first scan. This scan is done a maximum of one time and, if executed, replaces the "normal" first scanning which loads the file structure of the project into
first_scan_root_dir
.One potential problem with large project is that the scanning could take a while and the user has no feedback.
Also, the plugins are, maybe, not loaded when the scan of UIDs is executed. That means that it's possible that some custom loader will be missing, resulting in an impossibility to read some UIDs.
Tested with the MRP from #101677 and #100915.