It is currently Sun Dec 06, 2020 2:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to reduce file size?
PostPosted: Mon Jul 13, 2020 1:08 am 
Offline
User
User
User avatar

Joined: Thu Jul 02, 2020 9:52 pm
Posts: 40
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 2:44 am 
Offline
Addict
Addict

Joined: Fri Apr 25, 2003 11:10 pm
Posts: 1228
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


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 4:38 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 13, 2010 3:45 pm
Posts: 1143
Vernostonos wrote:
... its no longer going to fit on a 1.44mb floppy.

Excuse me, it's the year 2020.

_________________
sorry for my bad english


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 7:56 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3756
Location: Utah, USA
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 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?

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.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 8:48 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1099
jack wrote:
some AV will probably give a false positive on exe's packed with UPX

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.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 9:36 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Dec 23, 2009 3:26 pm
Posts: 220
You care about the exe size which made by PB? :shock:

_________________
poor English...

PureBasic & Delphi & VBA


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 9:40 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Mar 11, 2009 4:06 pm
Posts: 329
Location: NL
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 9:51 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 759
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Mon Jul 13, 2020 10:15 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Apr 10, 2017 6:17 pm
Posts: 395
Location: Germany
What is your software supposed to do? What is your target operating system?

Mijikai wrote:
Having the fastest and smallest code possible is a lost virtue.


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.

_________________
webpage


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Tue Jul 14, 2020 1:21 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 299
Why are people replying to a post from last century?
Usually spam bots respond to those. :D :D

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


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Tue Jul 14, 2020 8:18 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1099
normeus wrote:
Why are people replying to a post from last century?

What? This thread is only a day old.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Tue Jul 14, 2020 9:12 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 649
Location: Germany, Saarbrücken
Mijikai wrote:
Having the fastest and smallest code possible is a lost virtue.

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.

_________________
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Tue Jul 14, 2020 10:04 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Dec 23, 2009 3:26 pm
Posts: 220
NicTheQuick wrote:
Mijikai wrote:
Having the fastest and smallest code possible is a lost virtue.

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.


+1,general rules in programming,either room,or speed.

_________________
poor English...

PureBasic & Delphi & VBA


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Tue Jul 14, 2020 10:44 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 759
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.


Do you think they did not know that, whats your point?
Hardware has changed drastically so there is not the same incentive/requirement anymore to get the best result in both areas.


Top
 Profile  
Reply with quote  
 Post subject: Re: How to reduce file size?
PostPosted: Tue Jul 14, 2020 11:03 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 649
Location: Germany, Saarbrücken
Mijikai wrote:
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.


Do you think they did not know that, whats your point?
Hardware has changed drastically so there is not the same incentive/requirement anymore to get the best result in both areas.

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.

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. :D

_________________
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye