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

Severe regression in asset import speeds #95104

Closed
Jamsers opened this issue Aug 3, 2024 · 10 comments · Fixed by #95225
Closed

Severe regression in asset import speeds #95104

Jamsers opened this issue Aug 3, 2024 · 10 comments · Fixed by #95225

Comments

@Jamsers
Copy link

Jamsers commented Aug 3, 2024

Tested versions

  • Reproducible in: v4.3.rc2
  • Not reproducible in: v4.2.2.stable

System information

Godot v4.3.rc2 - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 32.0.15.6070) - AMD Ryzen 5 5600H with Radeon Graphics (12 Threads)

Issue description

First off, I will say that it feels like pretty much everything is slower in 4.3. Even simple things like changing project settings. But this one is the most egregious - it completely annihilates iteration speed.

4.2 import times:

4.2.Import.mp4

4.3 import times:

4.3.Import.mp4

It applies to all kinds of assets - so even something like creating a new material involves wait times of up to a minute.

Steps to reproduce

I have not confirmed yet, but the issue seems to only show up on large projects.

On Crater-Province-Level, to reproduce the video example:

  • Open project in Godot
  • Open Asset Sources/Model/Tunnel_All.blend in Blender
  • Export as glTF to Models/Tunnel_All.glb
  • Switch back to Godot window and wait until scene window is responsive again

Minimal reproduction project (MRP)

Crater-Province-Level:
test-4.2 branch

@Calinou
Copy link
Member

Calinou commented Aug 3, 2024

Can you test all pre-releases between 4.2.2 and 4.3.rc2 to help bisect the regression? You can download them here.

Make sure to remove the .godot/ folder between each test.

Note that #93877 may crop up if you have V-Sync disabled in the project settings, as V-Sync in the editor is now controlled by an editor setting since 4.3 (the project setting is ignored by the editor).

@Jamsers
Copy link
Author

Jamsers commented Aug 4, 2024

#93877 was actually my first guess, but disabling (editor) vsync and enabling continuous update didn't seem to help, so I reported this separate issue.

I'll try to bisect soon when I have the time.

@Jamsers
Copy link
Author

Jamsers commented Aug 4, 2024

Finished bisecting. The regression was introduced with commit 846bafd.

@akien-mga
Copy link
Member

That's #92279, CC @SaracenOne @lyuma @fire.

@akien-mga akien-mga moved this from Bad to Very Bad in 4.x Release Blockers Aug 4, 2024
@fire
Copy link
Member

fire commented Aug 4, 2024

TODO: get a profile to see what is slow

@lyuma
Copy link
Contributor

lyuma commented Aug 4, 2024

If this is related to that commit, it should be caused by the code to handle refreshing the open scenes, not the editor scene import system

can you verify if import is fast when there are no scenes open (close all scenes before saving the glb, and see how long until the editor is responsive)

That way we can rule out the core import system and focus instead on optimizing refreshing the open scenes.

@Jamsers
Copy link
Author

Jamsers commented Aug 4, 2024

Just tested, import is blazing fast when all scenes are closed. Also noticed while testing that closing and opening a scene is really slow, especially big scenes.

@Hilderin
Copy link
Contributor

Hilderin commented Aug 5, 2024

I'll do some debugging on that. On my computer I see way worst performance problem then @Jamsers with the MRP. Just opening a scene could take 1 min. and reimporting takes almost 2-3 min. On a debug build, it's even a lot worst.

@Hilderin
Copy link
Contributor

Hilderin commented Aug 5, 2024

So far, I found 2 main problems:

  • When opening the scene, the it takes 40 sec to request gizmos. When I comment Node3DEditor::_request_gizmo and Node3DEditor::_request_gizmo, it's down to 25 secs and the Editor is way more responsive right after the scene is loaded.
  • There are definitively some regression caused by Fix instanced .blend/GLTF scenes lose all children after update until .tscn is reopened #94093. Currently, preload_reimporting_with_path_in_edited_scenes take 9 sec and update_node_reference_modification_table_for_node 9 sec when reimporting. I'll look into the performance for reload the scene when reimporting.

@Hilderin
Copy link
Contributor

Hilderin commented Aug 5, 2024

I think I'm on the right track, finally, the major issues were from e57312d and #90531.

I need to retest a lot of things from #94093 to see if I did not break anything and check how to fix e57312d and #90531 another way before creating a PR.

godot.windows.editor.dev.x86_64_ZohJkASVm4.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Very Bad
Development

Successfully merging a pull request may close this issue.

7 participants
@fire @Calinou @akien-mga @Jamsers @lyuma @Hilderin and others