executable ~ 300% larger

Just starting out? Need help? Post your questions and find answers here.
Taz
User
User
Posts: 75
Joined: Sat Jan 20, 2018 5:28 pm
Location: Germany

executable ~ 300% larger

Post 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
User avatar
skywalk
Addict
Addict
Posts: 4242
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: executable ~ 300% larger

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Taz
User
User
Posts: 75
Joined: Sat Jan 20, 2018 5:28 pm
Location: Germany

Re: executable ~ 300% larger

Post 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.
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: executable ~ 300% larger

Post by Quin »

The changelog makes no mention of executables being smaller, and Fred wrote a blog post on why this is the case.
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: executable ~ 300% larger

Post 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:
Taz
User
User
Posts: 75
Joined: Sat Jan 20, 2018 5:28 pm
Location: Germany

Re: executable ~ 300% larger

Post 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:
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: executable ~ 300% larger

Post 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?
Taz
User
User
Posts: 75
Joined: Sat Jan 20, 2018 5:28 pm
Location: Germany

Re: executable ~ 300% larger

Post 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
Post Reply