Preload function and the exported game size.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DriNeo
:warning: Old Version Published before Godot 3 was released.

I noticed this code change_scene_to( My_scene ) is a lot more fast than change_scene("My_scene.tscn"). In the first case My_scene was “preloaded”.

I read preload loads the scene “during script parsing” so I wonder if the parsing is made on export time or in runtime.
If the parsing is made on export time is the packedscene duplicated in the node who calls preload ?

My scenes are currently too little to see a size difference, but it is possible that I will make a game with complex scenes later .
Sorry if my question seems stupid for experienced users.

:bust_in_silhouette: Reply From: Zylann

preload has no impact on game executable size. All it does is to make sure a resource is loaded as soon as the script is loaded (so, likely when the game starts or the scene loads) rather than at the time it is actually executed. So it’s just a difference on “when” rather than “how much” it loads.