blitzmax file size

BlitzMax Forums/BlitzMax Programming/blitzmax file size

Jesse(Posted 2007) [#1]
I created a program and I used the framework assist to make the file smaller.
release mode without framework assist I get 1.23MB
release mode with framewor assist I get 1.22MB
then I tried also with debug
debug mode without framework assist I get 2.46MB
debug mode with Framework assist I get 851KB

why is debug mode with framework assist smaller
than release mode with framework assist? it doesn't make sence to me.

this is the program I am testing it on:
Strict
Framework BRL.GLMax2D
Import BRL.FreeTypeFont
Import BRL.PNGLoader
SetGraphicsDriver GLMax2DDriver()

Graphics 800,600

SetBlend(alphablend)
Local size:Int = 32
Local r:Timagefont = LoadImageFont("c:\windows\fonts\cour.TTF",size)
If r = Null Notify "windows font not found";End
SetImageFont(r)

For Local y:Int = 0 Until 16
	For Local x:Int = 0 Until 16
		DrawText Chr(y*16+x),x*size,y*size
	Next
Next
Local pixmap:TPixmap = GrabPixmap(0,size*2+9,512,512)
If SavePixmapPNG(pixmap,"mypng.png") Notify "ok mypng.png file created"
Cls
DrawPixmap(pixmap,30,30)
SetAlpha .2
DrawRect(30,30,512,512)
SetAlpha 1.0
DrawText "press a key to continue",200,550
Flip()
WaitKey()


it assumes the TTF font is in the standard windows dir.


plash(Posted 2007) [#2]
release mode; with framework/imports, 562kb. without framework/imports, 1.24mb.

debug mods; with framework/imports, 851kb. without framework/imports, 2.48mb.


what exactly did u change when u built with "release mode without framework assist"?

here's how I built it
with framework/imports would be
Framework BRL.GLMax2D
Import BRL.FreeTypeFont
Import BRL.PNGLoader

and without would be
'Framework BRL.GLMax2D
'Import BRL.FreeTypeFont
'Import BRL.PNGLoader


Also what version of mingw are you using?


H&K(Posted 2007) [#3]
Same Numbers as Plash Here.


Jesse(Posted 2007) [#4]
Plash that is the way I checked. for wingw I assume is what everyone is using. I got it from the link in the tutorial by bot builder. I think is MinGW-3.1.0-1.exe.
I tryed to access it again but the link is dead.
anyway it has been a long time sence I rebuld the modules. I am going to rebuld them and see what happens.


plash(Posted 2007) [#5]
is blitzmax updated to 1.24? and have you done a syncmod recently?


xlsior(Posted 2007) [#6]
573,952 bytes in release mode with framework, using MinGW 5.0.2


Jesse(Posted 2007) [#7]
that is weard, I had to remove the installation completely and reinstall it to work right. cause when I installed over it, it still wouldn't work. finally!
now I get 576,000 bytes with framework in release mode. and 266kb compressed with winrar which is what I was looking for.


xlsior(Posted 2007) [#8]
now I get 576,000 bytes with framework in release mode. and 266kb compressed with winrar which is what I was looking for.


If you want to get it even smaller, I strongly suggest taking a look at UPX. (Free executable file packer)
With the --ultra-brute parameter, it shrinks the .exe down to 245KB (while still remaining a stand-alone .exe)

Packing this with WinRAR drops another 1KB to 244KB, but that's not really worth the hassle anymore.

(Thanks to UPX I've made a couple of command-line utilities that are only ~35KB in size... Anything with a graphics context adds a chunk in size, though)


Jesse(Posted 2007) [#9]
Thanks xlsior. I will look in to it for future use. Got any links?


xlsior(Posted 2007) [#10]
http://upx.sourceforge.net/#download

You probably want the Win32 Console version download.

And remember the --ultra-brute flag -- takes a little longer, but gets you the best compression.


Jesse(Posted 2007) [#11]
thanks.