If you’re a programmer who’s become fed up with software bloat, then may you find herein the perfect antidote. This document explores methods for squeezing excess bytes out of simple programs.
If you’re a programmer who’s become fed up with software bloat, then may you find herein the perfect antidote. This document explores methods for squeezing excess bytes out of simple programs.
This document has been around for years.. hardly newsworthy..
Kindof reminds me of Michael Abrash’s “Black Book”, but don’t think you’re going to be trim down some KDE or Gnome lib by these percentages. Most of the overhead is the entry/exit code and linker stuff that GCC puts in there.
I’m assuming Eugenia was reading the developer section of /. and when I knew I had read that article somewhere before and sure enough it was a dupe from a 2002 /. story. Oh well, better than 90% of the stuff that /. puts out as “News for Nerds”.
This is old, but it is a great article nonetheless. He should do one for PE executables!
So assembly makes smaller programs…big surprise there…
Unfortunately the source isn’t a one line C program anymore, and the source code is huge.
very nice article, fun to read, thanks.
upx.sf.net
slow news today?
Thanks Eugenia. Insofar as its principles are rapidly being forgotten to the detriment of computing, it’s an extremely timely article no matter how old. And it’s fascinating and useful reading, regardless. Nice to see stuff like this on OSNews.
Mastery over each and every byte, using no crutches, achieving perfect precision and efficiency. Those principles (and publicizing them) are not anything to scoff at.
A fun read. Reminds me of my youth trying to make
really small demos in assembly.
And, of couse, fully impractical.
Such practice would not be likely to be useful or significant on a program that does anything.
Indeed, I image that disk block sizes and memory page sizes are such that a program under 1k is likely
simply wasting space that it could be using.
All that trouble, and (on x86) the original 3.9KB program and the modified 45 byte program both take up a full 4KB page in RAM!
I went down this path last year with Win32 PE executables.
See the following links:
http://www.geocities.com/typopl/appsmall.htm
http://www.geocities.com/typopl/appsize.htm
While UPX reduces the size of your executable, it increases the runtime memory footprint despite what they say on their website.
…interesting reading, but it is soooo old.
remember the stripped and tiny system.tpu which u can use with turbo pascal?
win32 programs can be very small even using the gui.
but lets face it, if u want to do bigger projects than “hello world” u gonna put in many useless, redundant and obsolete functions.
OT: whats this Eugenia bashing anyway?
Good luck getting UPX to compile on *BSD.
Hey, that didn’t seem hard at all
Why not do this with Firefox, I’ll bet it’s really worth it
We might even be able to beat the 4MB download size of the win32 version, hehe….. (okay, that is probably TOO wishful thinking)
The article is old, I remember playing with it an age ago.
However, as a related topic, I’d be curious to know if anyone knows what happened to the folks behind the Linux asmutils project.
That was a project to produce tiny asm equivalents for some of the Linux userland (Eg mv, cat etc). I think most folks are aware of the arguments against using asm for everything, but that project really had some potential for embedded x86 systems. Unfortunately it looks like development just stopped sometime in 2002.
> All that trouble, and (on x86) the original 3.9KB program and the modified 45 byte program both take up a full 4KB page in RAM!
And it even works on Linux 2.6!
I’ve never seen anything like it. And fun to read too. I wouldn’t call it silly. Rather educational. It looks like the last version of the program is overall also the smallest allthough the source is bigger than some of the other versions.
> However, as a related topic, I’d be curious to know if
> anyone knows what happened to the folks behind the Linux
> asmutils project.
Well the last updates to the website were in January 2004, and there’s a little bit of traffic on the mailing lists, but it does appear to have died out. It’s a shame really, because it was a worthwhile project.
On the other hand, there are a lot of small C versions of the *nix tools. I’ve written several, and with dietlibc they can be pretty small. Not as small as assembly, but easier to maintain. My long-term goal is rewriting these tools in Forth 🙂