Home » Community » Coffee corner » how to reduce binary size? 
	
		
		
			| how to reduce binary size? [message #59486] | 
			Thu, 05 January 2023 02:53   | 
		 
		
			
				
				
				
					
						  
						Satervalley
						 Messages: 20 Registered: December 2022 
						
					 | 
					Promising Member  | 
					 | 
		 
		 
	 | 
 
	
		the binary size increased with version number. 
my app is about thousands loc, under windows, release build, blitz disabled, CLang x64, compile option -Oz -flto, the binary size about 4m. 
in the other hand, the SDL2 sample's binary size is 14KB(dynamic link to sdl dll). 
about 2-3 years ago, version number 9xxx - 10xxx, the same app's binary size is about half or 1/3 of it under the newest U++.
		
		
		[Updated on: Thu, 05 January 2023 02:55] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: how to reduce binary size? [message #59503 is a reply to message #59486] | 
			Sun, 08 January 2023 16:13    | 
		 
		
			
				
				
				
					
						  
						Novo
						 Messages: 1430 Registered: December 2006 
						
					 | 
					Ultimate Contributor  | 
					 | 
		 
		 
	 | 
 
	
		TheIDE allows you to build "All static" or "Use shared libs" configs. 
"All static" is a default configuration on Windows if I remember correctly. If you switch to "Use shared libs" binary size of your app will be smaller. A tradeoff is performance (dynamic name binding) and compatibility (this is usually a problem with Unix & libc). 
If you build a Release conf of your app with map-file enabled you can check code size of every function linked into your app using this app. 
It supports map-file formats of pretty much all compilers including old game consoles.
		
		
  Regards, 
Novo
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 09:18:15 CET 2025 
 Total time taken to generate the page: 0.04929 seconds 
 |