Reduce C/C++ Compile Time With distcc
An anonymous reader writes "Some people prefer the convenience of pre-compiled binaries in the form of RPMs or other such installer methods. But this can be a false economy, especially with programs that are used frequently: precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine. If you use a distributed compiler, you get the best of both worlds: fast compile and faster apps. This article shows you the benifits of using distcc, a distributed C compiler based on gcc, that gives you significant productivity gains."
Well, they might as well merge sites if they're going to share stories.
Until Slashdot fixes the funny modifier, use insightful or interesting. The poster knows your intentions.
Any application I have to compile before using with the 'correct optimizations for my machine' will take more time to get up and running than any 'productivity gains' it might produce. This is why Linux is still not accepted by mainstream computer users. They don't care how it works, just that it does.
Compare the speed cost of loading a "generic" binary to an "optimised" one, multiply by the number of times you load that binary.
Then look at the time required to compile the optimised copy.
How often, in the lifetime of a particular version of a binary, do you really need to reload it?
The promise of distcc is closely related to source distributions like Gentoo. The benefit is overstated. Don't waste your time.
Quick wafting zephyrs vex bold Jim
Which makes it a pain in the ass if you ask me.
I have tried to use distcc for a lot of stuff, but it doesn't work on some packages, and that's enough to make me not use it.
I don't want to have to hand-pick which packages to use it with and which ones to not use it with. Fortunately, a lot of Gentoo packages have a rule built in to not use distcc automatically, but it's not always the case.
The other thing about distcc is that it won't increase the speed of the compile by any large magnitude with each machine added because the machine performing the actual compile has to do a lot more work then the slaves.
Unless I was trying to compile something on a REALLY slow machine, I don't bother with distcc.
- It's not the Macs I hate. It's Digg users. -
Precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine
And there are maybe about ten to fifteen people on all of slashdot who actually know how to go about setting the right optimizations for their own machine.
There are still enterprise uses where coders need to compile huge projects from scratch that take too long on a single workstation. Instead of that build taking 15 minutes on a single workstation, they can tap the power of all the workstations and build it in a few minutes or perhaps even seconds.
thisnukes4u.net
"(...) a distributed C compiler based on gcc, that gives you significant productivity gains."
Assuming
a) That compiling will give you any significant performance increase (which I kinda doubt, it's not like the defaults are braindead either)
b) You don't spend more time mucking about with distCC / compiling than you'll actually use the software
c) Your software is actually code bound (and not "What do I type/click now?" human bound, or bandwidth bound or whatever)
I can't think of a single thing I do that's code bound. And I actually do a bit of compiling, but I spend those seconds thinking about what to code next. Either that, or it is bandwidth bound or non-time critical (i.e. does it take 6,5 hours or 7 hours? Who cares. The difference is half an hours work for my computer, 0 for me. So the time I'd spend to improve it is - gasp - 0.
Kjella
Live today, because you never know what tomorrow brings
In my home environment, I have my slow lil' K6 400 ship it's compile jobs to my Athlon XP with 512MB of RAM. Both are on the same local network. In a home environment, if you have a brawny box and a scrawny box, DISTCC is your best friend. (Assuming you have to do a pile of compiles.)
Another approach is to simply compile all your stuff on a powerful box, and copy the binaries to the scrawny ones.
"Learning is not compulsory... neither is survival."
--Dr.W.Edwards Deming
It's news to people that don't read slashdot every day.
I don't mind revisiting older topics once in awhile - it's only annoying when it's two days in a row. And even then, it's not that big of a deal, I simply pass over it.
Posts like this are more waste of space then then a duplicate article post, and you get a lot more posts like yours then we do dupes. It's especially annoying when people say "We talked about this TWO YEARS AGO!!!" Well here's some news for you: I don't memorize every slashdot story since the beginning, and there's been a lot of new members since then.
- It's not the Macs I hate. It's Digg users. -
Honest question: gcc has the reputation of not producing the fastest code for x86, so why should I bother compiling gentoo with gcc or distcc?
Does anyone know if there are distro's compiled with, say, the Intel compiler?
The Anti-Gentoo zealots always say stuff like "It's not going to be faster.." etc etc..
:P
Now someone is saying: "precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine."
So, the Gentoo users that are claiming that stuff compiled with the right optimizations *is* faster?
I'm confused. Which is it supposed to be? Are Gentoo users full of crap, or are they correct?
I use Gentoo and have found things to be a hell of a lot easier to deal with than RPM based binary distros anyway.
I just want the scoop.
Oh, distcc has been in Gentoo for a while.. surprised to see it listed like it's a new thing.
precompiled binaries will never run as quickly as those compiled with the right optimizations for your own machine
A straw man. Precompiled binaries may have been compiled with the optimal settings for your machine, and binaries which you compile may not have the optimal settings. Identifying the optimal settings can actually be non-trivial. Source-based distributions are not necessarily the best fix to the 'one-size-fits-all' approach used by some distro's.
Well, that won't help anyone, since almost nobody runs Plan 9.
Also, advising people to use faster compilers is bad advice. The point is to make the application faster, and the slower the compile, the faster the application is likely to run. eg. GCC2 vs GCC3
Yes, you are reducing the time it takes to complete the process. It doesn't reduce CPU-time, it reduces real-time. You know, the real world, in which we live... The only thing that really matters.
Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
I wouldn't. I compile my programs once, then use them for MONTHS on end. Even a tiny speed improvement in something like Mozilla will save a HUGE ammount of time overall, and by far make up for the compile time.
When I am programming, I'll disable ops so I can test my changes quicker, but that's not what we are talking about here...
Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant