How to reduce file size?
- Vernostonos
- User
- Posts: 58
- Joined: Thu Jul 02, 2020 9:52 pm
How to reduce file size?
Are there any tricks for keeping file size down for a PB project?
I just hit 101 kb and have only half of my character creation system finished. I'm worried once all the dialog, custom fonts, and locations are completed its no longer going to fit on a 1.44mb floppy.
I just hit 101 kb and have only half of my character creation system finished. I'm worried once all the dialog, custom fonts, and locations are completed its no longer going to fit on a 1.44mb floppy.
Re: How to reduce file size?
for executable or dll you could use UPX https://upx.github.io/
however, some AV will probably give a false positive on exe's packed with UPX
however, some AV will probably give a false positive on exe's packed with UPX
Re: How to reduce file size?
Excuse me, it's the year 2020.Vernostonos wrote:... its no longer going to fit on a 1.44mb floppy.
sorry for my bad english
Re: How to reduce file size?
If it is just for the storage of your portable working files I would suggest using a thumb drive. Is there any reason why you would be limited to only a 1.44 mb floppy?Vernostonos wrote:Are there any tricks for keeping file size down for a PB project?
I just hit 101 kb and have only half of my character creation system finished. I'm worried once all the dialog, custom fonts, and locations are completed its no longer going to fit on a 1.44mb floppy.
If it is for the executable that you will produce from the project then a smaller file that loads and uncompresses the main file before running it may be the way to go.
Re: How to reduce file size?
That doesn't happen anymore. The AV just unpacks it. Packed/unpacked is the same AV results. I've done LOTS of tests in this area.jack wrote:some AV will probably give a false positive on exe's packed with UPX
Re: How to reduce file size?
You care about the exe size which made by PB?
poor English...
PureBasic & Delphi & VBA
PureBasic & Delphi & VBA
Re: How to reduce file size?
You will find that as long as you do not need additional PB libraries, the file will not grow much. The libraries is what increases the size. Unless you have a ton of text in your file (maybe compress/uncompress at runtime). But I would wait with that till completion and only if necessary... If that's the case, then the text should move to an external file anyway to simplify maintenance or even translation.
Re: How to reduce file size?
Use 'bits' or the BriefLZ packer to grunch down fonts and graphics.
Break down your code in procedures -> reuse code as often as possible.
Use ascii when storing strings - unicode is a waste.
Good luck
Edit:
I really like such projects and i totally see that u need the floppy.
Having the fastest and smallest code possible is a lost virtue.
Break down your code in procedures -> reuse code as often as possible.
Use ascii when storing strings - unicode is a waste.
Good luck
Edit:
I really like such projects and i totally see that u need the floppy.
Having the fastest and smallest code possible is a lost virtue.
Re: How to reduce file size?
What is your software supposed to do? What is your target operating system?
The good old times of manipulating exe headers to save a few bytes on disk I remember some people invented their own assembly language for size competitions done by Hugi.Mijikai wrote:Having the fastest and smallest code possible is a lost virtue.
Re: How to reduce file size?
Why are people replying to a post from last century?
Usually spam bots respond to those.
I had trouble loggin, in to post this. It gave me a "too many failed attempts" error so there are spammers trying to hack into the Forum.
Norm.
Usually spam bots respond to those.
I had trouble loggin, in to post this. It gave me a "too many failed attempts" error so there are spammers trying to hack into the Forum.
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Re: How to reduce file size?
What? This thread is only a day old.normeus wrote:Why are people replying to a post from last century?
- NicTheQuick
- Addict
- Posts: 1226
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: How to reduce file size?
It's not always the smallest code that is the fastest. In fact many codes can be made faster when you use a better and also bigger structure and better algorithms. Compare Bubblesort with Quicksort.Mijikai wrote:Having the fastest and smallest code possible is a lost virtue.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Re: How to reduce file size?
+1,general rules in programming,either room,or speed.NicTheQuick wrote:It's not always the smallest code that is the fastest. In fact many codes can be made faster when you use a better and also bigger structure and better algorithms. Compare Bubblesort with Quicksort.Mijikai wrote:Having the fastest and smallest code possible is a lost virtue.
poor English...
PureBasic & Delphi & VBA
PureBasic & Delphi & VBA
Re: How to reduce file size?
Do you think they did not know that, whats your point?NicTheQuick wrote:It's not always the smallest code that is the fastest. In fact many codes can be made faster when you use a better and also bigger structure and better algorithms. Compare Bubblesort with Quicksort.
Hardware has changed drastically so there is not the same incentive/requirement anymore to get the best result in both areas.
- NicTheQuick
- Addict
- Posts: 1226
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: How to reduce file size?
Of course not all programmers know that. That's the reason I wanted to point that out more specifically. It's just not true, that's all.Mijikai wrote:Do you think they did not know that, whats your point?NicTheQuick wrote:It's not always the smallest code that is the fastest. In fact many codes can be made faster when you use a better and also bigger structure and better algorithms. Compare Bubblesort with Quicksort.
Hardware has changed drastically so there is not the same incentive/requirement anymore to get the best result in both areas.
But I agree that today's code bases often are way more bloated then their need to be. So in general you need the right balance to use CPU caches, branch predictions and the best instructions the CPU has to offer in a efficient way. Of course, on small microcontrollers with 1 MB of flash memory or less you need to look at each bit individually to get the smallest executable possible. But that's a totally different way of programming than on modern computers with more Cache than these microcontrollers have memory available.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.