Automatical use of UPX possible?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
hoppel
Level 3
Level 3
Posts: 174
Joined: Wed Oct 10, 2007 1:38 pm

Automatical use of UPX possible?

Post by hoppel »

Hello,


I'm trying to find a safe and easy way of using the UPX packer under Linux. Under Windows I just pack every program after the installation. Since the software is installed manually I know when it's time for the use of UPX.
Under Linux it is more complex. First, it is circuitous to pack a program if you have to use root. The easiest way I figured out was packing the Linux files under Windows by using a ext3 file system for Windows. Secondly it is dangerous, because every executable lies in the same directories - when I packed whole usr/bin the system didn't start the next time because obviously some files had been packed which mustn't... And thirdly there is no use in packing the executables separately, because after the next automatic upgrade without noticing the packed files are gone.

I'd still like to pack my files, because I want to save space on my hard disk and because it makes programs start faster. But there should be a way of doing it automatically by synaptic or by installing prepacked programs.

Is there already a way of doing it in one of this two ways?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Re: Automatical use of UPX possible?

Post by scorp123 »

hoppel wrote: I'm trying to find a safe and easy way of using the UPX packer under Linux.
What's that? Never heard of that. :?
hoppel wrote: Under Windows I just pack every program after the installation.
Linux is not Windows!! :shock:
http://linux.oneandoneis2.org/LNW.htm
hoppel wrote: The easiest way I figured out was packing the Linux files under Windows by using a ext3 file system for Windows.
You are using a Windows program to manipulate Linux binaries??? That's definitely a great way to hose your installation and to destroy those binaries :lol:
hoppel wrote: when I packed whole usr/bin the system didn't start the next time
You're not supposed to touch such important system locations manually. And especially not with Windows tools!! :shock:
hoppel wrote: I'd still like to pack my files, because I want to save space on my hard disk and because it makes programs start faster.
Let go of your Windows habits. Linux binaries are more or less already optimised (to sane levels at least). Linux is not Windows.
hoppel wrote: Is there already a way of doing it in one of this two ways?
Why would I want to do that??? Windows must be a seriously *BROKEN* operating system if it teaches users to do such things and they even regard such monstrous manipulations of system binaries as being 'normal'. :shock:

To keep it simple: Nope, on Linux we don't do such things. The binaries already are small like hell and optimised. There is no need for touching them. Especially not by third-party tools written for an entirely different (and apparently utterly broken-by-design!!) OS which has no idea about the structure and innards of a Linux binary!! :?
hoppel
Level 3
Level 3
Posts: 174
Joined: Wed Oct 10, 2007 1:38 pm

Post by hoppel »

Well, you should give it a try yourself. Because of UPX my Windows programs start faster than the Linux ones. Easy to compare with Firefox under both systems.
you are using a Windows program to manipulate Linux binaries??? That's definitely a great way to hose your installation and to destroy those binaries
No, UPX can pack Windows, Linux and even Atari program files. It doesn't matter which platform you use for UPX itself. And btw., I tested it successfully with Linux programs, and they are also getting much faster. The only problems are the ones mentioned above. The Linux way of putting every program in usr/bin is a real problem here. Since that couldn't be changed I'm searching for another way.
The binaries already are small like hell and optimised. There is no need for touching them.
Well, you're wrong. Or maybe you're not quite right. They could be more optimized.

http://upx.sourceforge.net/
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

hoppel wrote: Well, you should give it a try yourself.
And hose my perfectly running Linux systems??? No thanks :lol: :lol: :lol:
hoppel wrote: No, UPX can pack Windows, Linux and even Atari program files. It doesn't matter which platform you use for UPX itself.
OK, my bad. I honestly didn't know about this UPX thing. But so far you're the only guy using this it seems (at least here) ... or else I suppose this would be wider known around here?
hoppel wrote: And btw., I tested it successfully with Linux programs, and they are also getting much faster.
I doubt that this really makes such a difference. On a decent system with a reasonable fast disk and fully supported disk controller I doubt you will notice any difference. Also: How do you test this? Do you reboot between your attempts? Because if you first start Firefox (before using UPX) then portions of it will be in the system's cache and buffer memory (portions of your RAM that are idle and are re-routed to perform this job). When you then start it again it will show up way way faster than it did before: because now the additional cache and buffers come into play and programs will be loaded faster. So if you used UPX between the two runs then the perceived speed-increase may also have a lot to do with all the buffering going on. So for a serious test you'd have to reboot your machine between the runs and make sure nothing is in the memory buffer.

But as I said above ... I doubt that you will get lots of speed increase out of this. All this reminds me of old Windows programs such as "RAM Doubler" and "MagnaRAM", and such which promised to 'optimize and even double your RAM' so programs would run faster. Yeah yeah. Right. I'd rather spend my money on more RAM and super-fast SATA disks ...
hoppel wrote: Well, you're wrong. Or maybe you're not quite right. They could be more optimized.
Even if ... we're talking fractions of seconds here. Sorry to say so, but that's almost ridiculous. And the really big chunky parts are not really the binaries themselves but all the libs (Qt, GTK+, and what not else....) that need to be loaded too.

If you really want to have a distro where you can tune your binaries to the max: get Gentoo Linux and then set your 'build options' to optimise your binaries like mad. That should do it then for you.

Besides ... Whenever you update a program package chances are that your 'optimised' binary will be replaced and overwritten again.

As I said above. It would be better to spend a bit money on decent hardware (more RAM is always good) and not touch the OS's binaries.
hoppel
Level 3
Level 3
Posts: 174
Joined: Wed Oct 10, 2007 1:38 pm

Post by hoppel »

Do you reboot between your attempts? Because if you first start Firefox (before using UPX) then portions of it will be in the system's cache and buffer memory (portions of your RAM that are idle and are re-routed to perform this job).
I'm well aware of these things. I'm using it since years on Windows, and believe me: I compared a lot. I also compared it with the NTFS-built-in-compression, which is also useful, but painful slow (Anyway, is at least something similar to that function under Linux?).
But as I said above ... I doubt that you will get lots of speed increase out of this. All this reminds me of old Windows programs such as "RAM Doubler" and "MagnaRAM", and such which promised to 'optimize and even double your RAM' so programs would run faster. Yeah yeah. Right. I'd rather spend my money on more RAM and super-fast SATA disks ...
UPX is not a hoax! It's just a runtime compressing tool, like many others. It's just the best and fastest. Since the programs are also much smaller after compresing, your theorie is easily disproved.
Maybe you never use Windows? But if you know the famous portable apps http://portableapps.com/ they are already compressed with UPX by the distributors. There are also lots of programmers who use it to gain the highest possible speed, for example koolplaya http://www.koolplaya.de is already compressed. It's used by commercial programs, too...
If you really want to have a distro where you can tune your binaries to the max: get Gentoo Linux and then set your 'build options' to optimise your binaries like mad. That should do it then for you.
That's not the same. I really like Linux, most of the time it is faster than Windows, but when I see my Windows version of Firefox starting faster using WINE than the Linux version (and I even tried Swiftfox), than IMHO there's a design flaw.
As I said above. It would be better to spend a bit money on decent hardware (more RAM is always good) and not touch the OS's binaries.
Maybe you buy a new computer every time a program starts slowly, but I thought that's a Windows user attitude.
Besides ... Whenever you update a program package chances are that your 'optimised' binary will be replaced and overwritten again.
That's exactly the problem I'd like to get rid off.
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

hoppel wrote: UPX is not a hoax! It's just a runtime compressing tool
Yes, I know. But I still question the validity of some of the points people make about its use. Where I personally see a perfectly OK example where UPX should used is e.g. if you want to build a really small distro that will fit as much as possible on a small "mini-CD" or USB-stick ...

But on a normal PC ... Sorry, but I doubt that there would be any noticeable speed gains.
hoppel wrote: That's not the same.
Nope, it's even better. Gentoo --provided you configured it properly-- produces super-fast-as-hell binaries. When I still worked for HP we built a server once, just for the purpose of playing around with it: Gentoo on really nice hardware (ProLiant server!), 'make.conf' optimisation levels to the max, and everything "non-essential" thrown away. The speed of this thing was mind-blowing.
hoppel wrote: but when I see my Windows version of Firefox starting faster using WINE than the Linux version (and I even tried Swiftfox), than IMHO there's a design flaw.
Sounds more like you have problems with your disk partitions , e.g. everything on one filesystem .... except /home maybe (sorry should this be a wrong assumption here ...)? So the Firefox inside WINE would then probably live on your /home partition, whereas the native Linux Firefox will be on /usr .... If /usr somehow got badly fragmented (as would be the case if you didn't separate it from the rest ...) then anything and everything that needs to start from it is super-duper slow.

Again ... I am just guessing here as I have no idea about your level of knowledge and how you setup your system. This is just to --maybe-- give you a hint that your system may have other more serious troubles than 'bloated' binaries. Linux tries very hard to avoid fragmentation, but once a filesystem really is fragmented then things will start going super-slow. Maybe this is what you experience here?

On my HP dv2108ea laptop (Intel Core Duo, 1.6 GHz, 1 GB RAM) Firefox gets completely loaded within 2-3 seconds. With caching and buffering in place (e.g. it was already once loaded) it's almost there instantly. And this is my 'workhorse' laptop which drag to the office daily and to customers, and to on-site visits ...
hoppel wrote: Maybe you buy a new computer every time a program starts slowly ....
I wish. :lol:
hoppel
Level 3
Level 3
Posts: 174
Joined: Wed Oct 10, 2007 1:38 pm

Post by hoppel »

Sounds more like you have problems with your disk partitions , e.g. everything on one filesystem .... except /home maybe (sorry should this be a wrong assumption here ...)? So the Firefox inside WINE would then probably live on your /home partition, whereas the native Linux Firefox will be on /usr .... If /usr somehow got badly fragmented (as would be the case if you didn't separate it from the rest ...) then anything and everything that needs to start from it is super-duper slow.
I must admit, that I haven't tested it that way. I just wanted to say, that the speed difference is noticeable. But your example about the usb-stick is quite good - starting the Windows version of Firefox from my USB 1.1 stick gives a considerable extra speed if using the upx-compressed version.
And if you're a convinced Gentoo-user, what are you doing in this forum? ;-)
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

hoppel wrote: And if you're a convinced Gentoo-user, what are you doing in this forum? ;-)
Gentoo is nice for certain purposes ... but I wouldn't want to use it on a daily basis. It just breaks too easily. And if you're an update-junkie ... Well, on Gentoo this means you'll be compiling day and night. That's not really productive. If anything then I am a "Debian-junkie". I just love all those Debian-based distros, simply because of "apt" and all the flexibility you get with it.
Locked

Return to “Beginner Questions”