godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.16k stars 20.21k forks source link

Editor reloads and parses unrelated files on save #24252

Open QbieShay opened 5 years ago

QbieShay commented 5 years ago

Godot version: 11d7738

OS/device including version: 4.19.4-arch1-1-ARCH

Issue description: I noticed that, when saving a scene, Godot is parsing GDScript files that are completely unrelated to the scene. I could notice that because that script contains an error and it showed up in the terminal. The script was not one of the open scripts in the script editor, does not declare any class name and is completely unrelated to the scene i was saving. The questions is: why is Godot parsing files at save time? My concern is that, if the project grows very big, the save time will grow until it becomes noticeable. For me it was around 1 second, with a project that has around 6k files.

Zylann commented 5 years ago

I also noticed in another issue that Godot appears to load (and then compile) GDScript files just to generate thumbnails out of them, regardless of where the script is. Maybe it's related?