Page 1 of 1

executable ~ 300% larger

Posted: Mon Jan 06, 2025 4:35 pm
by Taz
The size of the executable files has been much larger since PureBasic version 6.1X.
Up until version 6.04, it was much smaller.

I am writing this in the bug forum because the changelog says that the size of the executable files would be smaller, but the opposite is the case.

Here is an example:

Code: Select all

EnableExplicit
If OpenWindow(0, 0, 0, 230, 90, "Event handling example...", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
	ButtonGadget  (1, 10, 10, 200, 20, "Click me")
	CheckBoxGadget(2, 10, 40, 200, 20, "Check me")

	If CreateMenu(0, WindowID(0))
		MenuTitle("Menu")
		MenuItem(1, "Item 1")
		MenuItem(2, "Item 2")
		MenuItem(3, "Item 3")
	EndIf

	Repeat
		Select WaitWindowEvent()
			Case #PB_Event_CloseWindow
				Break
			Case #PB_Event_Gadget
				Select EventGadget()
					Case 1: Debug "Button 1 clicked!"
					Case 2: Debug "Button 2 clicked!"
				EndSelect
			Case #PB_Event_Menu
				Select EventMenu()
					Case 1 : Debug "Menu item 1 clicked!"
					Case 2 : Debug "Menu item 2 clicked!"
					Case 3 : Debug "Menu item 3 clicked!"
				EndSelect
		EndSelect
	ForEver
EndIf
PureBasic x64 6.04: 59Kb
PureBasic x64 6.12: 234Kb
Image

Re: executable ~ 300% larger

Posted: Mon Jan 06, 2025 4:58 pm
by skywalk
Not a bug as this has been discussed many times.
v620b2 x64 CBE
[x] Optimize generated code
[x] Create threadsafe executable
[x] Enable DLL preloading protection
[x] Use shared UCRT
= 68.5KB

[ ] Use shared UCRT
= 236KB.

Re: executable ~ 300% larger

Posted: Mon Jan 06, 2025 5:49 pm
by Taz
ok thx for info, but:
[x] Use shared UCRT
has no effect on version 6.12, whether I use the option or not, both executable files are 241kb.

Re: executable ~ 300% larger

Posted: Mon Jan 06, 2025 6:03 pm
by Quin
The changelog makes no mention of executables being smaller, and Fred wrote a blog post on why this is the case.

Re: executable ~ 300% larger

Posted: Mon Jan 06, 2025 6:11 pm
by Quin
Taz wrote: Mon Jan 06, 2025 5:49 pm ok thx for info, but:
[x] Use shared UCRT
has no effect on version 6.12, whether I use the option or not, both executable files are 241kb.
That's because this option was introduced in the 6.20 beta :wink:

Re: executable ~ 300% larger

Posted: Mon Jan 06, 2025 6:35 pm
by Taz
Quin wrote: Mon Jan 06, 2025 6:03 pm The changelog makes no mention of executables being smaller...
pictures say more than words:
Image

Quin wrote: Mon Jan 06, 2025 6:11 pm ...
That's because this option was introduced in the 6.20 beta :wink:
Ok, sorry. I built the IDE a few days ago, so I had the option in the 6.12 version. :oops:

Quin wrote: Mon Jan 06, 2025 6:03 pm ...and Fred wrote a blog post on why this is the case.
Thanks everyone, now I understand :idea:

Re: executable ~ 300% larger

Posted: Mon Jan 06, 2025 7:31 pm
by Quin
Taz wrote: Mon Jan 06, 2025 6:35 pm
Quin wrote: Mon Jan 06, 2025 6:03 pm The changelog makes no mention of executables being smaller...
pictures say more than words:
Image
Sorry, but you happen to have stumbled onto one of the few forum members who can't view images, I'm fully blind. This was mentioned in the changelog as:
- Updated : Toolchain on Windows now use VisualStudio 2022 and new MSVCRT for faster PureBasic programs and easier external libs integration.
Mind pasting the line in question?

Re: executable ~ 300% larger

Posted: Tue Jan 07, 2025 12:38 pm
by Taz
I didn't know that, I meant the news from June 5, 2024, version 6.11:
Updated: replaced polink with lld-link on Windows to generate smaller executables