godotengine / godot

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

Export size of windows desktop executable increased in 4.3 compared to 4.2.2 #96088

Open Arondy opened 2 weeks ago

Arondy commented 2 weeks ago

Tested versions

v4.3.stable.official [77dcf97d8] v4.2.2.stable.official [15073afe3]

System information

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

Issue description

I have a newly created project with one scene of Node2D in Godot v4.2.2. Exported executable with default export template and embedded PCK has size of 67,984 KB. The same project in v4.3 when exported with the same settings and "Compressed binary tokens" weights 82,151 KB. Hasn't 4.3 version aimed towards executable's size reduction? Or is this a feature for Web export only?

Steps to reproduce

  1. Create new project.
  2. Add Node2D and save scene.
  3. Export project with Windows Desktop option and embedded PCK.

Minimal reproduction project (MRP)

MRP.zip

akien-mga commented 2 weeks ago

Godot 4.3 has more features, which means more code, and thus an increase in binary size.

14 MB increase is significant though and should be looked into. Part of it is probably the new D3D12 renderer, but I wouldn't expect it to be that heavy.

Edit: Checked some export templates I had installed locally:

67M 4.2.2.stable/windows_release_x86_64.exe
67M 4.3.dev1/windows_release_x86_64.exe
67M 4.3.dev2/windows_release_x86_64.exe
75M 4.3.dev3/windows_release_x86_64.exe
76M 4.3.dev4/windows_release_x86_64.exe
77M 4.3.beta1/windows_release_x86_64.exe
80M 4.3.beta3/windows_release_x86_64.exe
81M 4.3.rc1/windows_release_x86_64.exe
81M 4.3.stable/windows_release_x86_64.exe

So it went from 67M to 75M in dev3, which is indeed the first release where official builds include D3D12 support (after https://github.com/godotengine/godot-build-scripts/pull/92).

There's another minor 3M bump between beta1 and beta3 worth looking into too.

CC @bruvzg

bruvzg commented 2 weeks ago

So it went from 67M to 75M in dev3, which is indeed the first release where official builds include D3D12 support

The size of the Mesa-NIR static lib is about 11 MB, so it looks expected.

bruvzg commented 2 weeks ago

And I do not see any significant difference between beta1 and beta3 sizes in local builds (about 260 KiB increase). Maybe something in the build containers was changed?

akien-mga commented 2 weeks ago

I checked, the size increase started in beta2, which coincides with the update of build containers from Fedora 39 to Fedora 40: https://github.com/godotengine/build-containers/pull/141 So it seems the mingw-gcc update got us significantly bigger binaries too.