Executable Size
BlitzPlus Forums/BlitzPlus Programming/Executable Size
I don't normally write apps, but I have to write a couple, and I may use BlitzPlus. Now I know BlitzPlus is exploring some technology which will make it into BlitzMax, so I'm guessing that includes a more intelligent compiler for smaller exe's. But how small are "hello world" exe's in B+?
Yes, I know this question has been asked 1,000 times before but I can't find the answer in the first few pages, and the search gives me bugger all.
a=CreateWindow("",32,32,96,96)
b=CreateLabel("",2,2,64,24,a)
SetGadgetText b,"Hello World"
WaitKey()
End
and the exe is 680kb!
"so I'm guessing that includes a more intelligent compiler for smaller exe's."
-- you're guessing wrong :)
I think I remember reading a post by mark (does he actually still live btw? Havnt read anything from him for quite a while :( ), where he was explaining that BlitzMax will consists of modules wich would (theoreticly) cause the final exe to be compiled with the entire DX/GL library, but only the functions and stuff that was actually used.. this should create smaller executables.. But, as said before 'I think I remember reading' so dont take my word for it
and the exe is 680kb!
That gets amortized though. As you add more code, the EXE size won't grow linearly.
Yep, it's because it includes a "runtime" into the exe (not sure how, i've been wondering for a long time...) which makes it big.
Ok, thanks for the answers guys. Yes, it does seem I guessed wrong. In that case I may as well stick with Blitz2d and XLnt. Exe sizes appear to be about the same.
A final Blitz .EXE is the run-time itself, while your own code is included as a resource in the DATA field of the .EXE file. I guess this part is loaded and started by the run-time.
Actually, there's a chance a Blitz2D exe will be smaller than a Blitz+ exe, for lack of the gui code. On the other hand, Blitz+ is more optimised, so it could balance out. Ish.
I've heard that if you UPX the DLLs in your Blitz folder, then all compiled Blitz EXEs come out smaller!! :D
yeah you can get an exe down to 350-400k (using UPX)
Protean (www.proteanide.co.uk) actually allows you to set a pre and post processor exe/script, so you could set this up as a postprocessor and never have to worry about your Blitz exes being huge again =]
Well, in the next update, ish, anyway... ;]