Slashdot Mirror


Linux on an Intel PIII vs. G4?

An anonymous submitter sent in: "I'm currently looking into purchasing a new laptop. This machine will run SuSE linux and I will be developing some pretty processor intensive applications(genetic algorithms, mathmatical simulations,etc.) so raw speed is the major factor. I've been searching for information on the relative speeds of an 850Mhz P3 vs a 500Mhz G4 but all tests I've seen are on the 'native' OS (OS9/X vs WinMe/2000). Has anyone out there done some tests running the same OS (linux/openBSD)?"

3 of 47 comments (clear)

  1. Ask SuSE Folks by waldoj · · Score: 4

    This sure ain't getting marked as +1 Informative, but had you considered checking with the SuSE teams? As one of very few distros that are processor-agnostic, I bet they've done some tests of their own.

    FWIW, OS X server on a PPC outperformed Linux on an Intel 450 PII by 23%, according to osOpinion. (YMMV, read the fine print, etc., etc.)

    -Waldo

  2. For raw speed, ditch gcc. by Christopher+Thomas · · Score: 4

    Your main problem if you're looking for a speed boost for applications won't be the processor - it'll be the algorithms you use and the compiler.

    For the algorithm:

    One word. Cache.

    Main memory is up to an order of magnitude slower than the cache. Make your algorithms cache-friendly. This means optimizing row vs. column accesses and doing checkerboarding for things like matrices, and other optimizations for vectors. For things like linked lists and trees, try to keep nodes contiguous with other nodes in memory where possible (or even just the key and linkage pointers, since that's all you'll be accessing most of the time when doing a search).

    It takes a while to fully zen into this, but it will pay off in spades.

    For the compiler:

    The following applies to the gcc C/C++ compiler. I'm assuming that you'll get similar performance results for the g77 Fortran compiler. You're on your own for hand-optimizing Fortran (I don't know the language).

    Gcc is a nice tool; it's free, and it works well. Unfortunately, even with -O3 -funroll-loops, it can't optimize for beans. I had to study this in detail as a project for one of my grad courses, and I was appalled when I found out just how many potential optimizations it wouldn't catch.

    If you're at the point where you're ready to optimize core algorithm code without worrying about it staying simple, then either replace it with inline assembly or (for better portability) write "pseudo-assembly" C code, with temp variables with the "register" keyword instead of registers, and statements only performing operations that can be easily mapped to machine code. Hand-unrolling and hand-software-pipelining worked wonders. Gcc will do the unrolling for you, but not the pipelining (I think) and it won't move even obvious candidate variables to registers.

    Using a chip with a large register set (like the PPC) makes this a bit more scalable, but it still works well on x86 chips (to a point). I tested on x86 and Sparc architectures.

    Lastly, bear in mind that you might, if you're lucky, get a factor of 10 out of all of this. Make sure that your algorithm is of a well-behaved order, and consider using a cluster of PCs for anything really power-hungry (though that involves optimizing communications, too).

  3. Processor features by autocracy · · Score: 5
    Here are the key processor features:
    • Pure speed: Mhz is the definiton used here. The higher the number, the more cycles you get every second.
    • Bandwidth: Measured in bits. Currently, Alpha, UltraSparc, and PowerPC G4 chips have a 64 bit setup. All modern intels only reach 32 bit (forget IA-64, it's not really "out there").
    • Cache: Alpha and UltraSparcs carry a hefty 8 MB of processor cache. Xeon chips carry 1 and 2 MB caches. Pentiums usually have around 1/2 MB, and so I believe for the G4.
    • Coding: Not really measurable, but here is what the processors excel at:
      • Alpha and UltraSparc: The big boys, these chips can handle anything. Usually used in database servers because of there massive caches.
      • G4: Graphics and heavy math. The 64 bit data path allows much more information to travel through the chip per cycle than Intels. Any parallel data will go much faster here than on Intel.
      • Xeon: Honestly, it's over-priced crap. Go buy an Alpha or an UltraSparc.
      • Pentium: They do something? Wow! Seriously, the P4s aren't much help unless you can optimize for them. PIIIs can hold there own, but being consistently beat down by Athlons running at lower speeds is shaming them. The Pentium's only true strengh is that it is the most common chip, and therefore has more option (mobos, SMP, etc.).
      • Athlon: There over-clockability is the shining point. If you don't mind screwing around with you box, go buy a water cooler and an Athlon 1.33 Ghz and pair it up with PC2100 (?) DDR RAM. You'll get a 266Mhz transfer on data from their RAM. And it all costs less than an off-the-shelf Pentium.

    Overall, go for an Alpha first, then the UtlraSparc (interchangeable). Obviously you can't really use these in a laptop, but they are there. Next shoot for a G4. You get more for your money at the lower speeds. Athlons are next. They ARE hard to find in laptops, but worth it (I think). Else, get a PIII.

    I can almost bet that any benchmarks you do will follow my suggestions.

    I can't be karma whoring - I've already hit 50!

    --
    SIG: HUP