Welcome to P2PNET.net - The original daily p2p and digital news site. Always First!
Register | Login
RIAA News
Cool Stuff
MPAA News
Games / Consoles
News
Music
Movies
TV
Open Source
Mobiles
Advertising
Product News
P2P
Off Topic
Freedom
Politics
Interviews
Security
DRM
Links
Kids and Kartels
Search: 
Search
 
Web P2PNET   
Search: 
Search
Torrent Site Tracker
TekSavvy
 
Add real-time p2pnet headlines to YOUR site ! Click here to download our newsfeed code

Linux trumps OS X

p2p news feature / p2pnet: Which is faster for stats, Linux or Apple’s OS X?

Linux, says Jasjeet Sekhon, associate professor, Travers Department of Political Science Survey Research Center at UC Berkeley.

What does the Apple crowd have to say about that?

“I joke that my webserver survived the digg onslaught and my mailserver the Apple fraternity onslaught,” Sekhon told p2pnet. “Joking aside, the response from the fraternity has been mostly but not entirely civil. A running issue has been that they don’t think it is fair to compare OS X with Linux because the latter is a specialty operating system. I find this claim to be bizarre.

“One is obviously not going to be running Photoshop on Linux (other than via vmware or something), but the both are general operating systems. In any case, I added the Windows XP results (which I knew about before hand) to the webpage in response.

“Even Windows XP performs better than OS X, which is embarrassing for Apple and a testament to Microsoft engineering given the legacy software requirements of Windows.

“The one very helpful response has been from people who run the Virginia Tech G5 high performance computer system. They revealed to me that they get their excellent performance by using a modified memory manager – ie, they dispensed with the OS X memory manager.

“This key fact is of course missing from Apple’s websites and PR on the Virginia Tech system.”

Linux versus Mac OS X and Windows XP on Intel Dual Core
By Jasjeet SekhonUC Berkeley

Linux is found to be much faster
than Apple’s OS X for
statistical computing. And although Linux is 5 to 10 percent faster
than Windows XP, both are markedly faster than OS X. For example, in
one benchmark both Linux and Windows XP are more than twice as
fast as OS X
. The results on this page were conducted on a href="http://www.apple.com/macbookpro">MacBookpro with a 2.16Ghz
Intel Core Duo chip and 2GB of RAM.

I had previous conducted Linux vs. Mac OS X and
Windows XP and Opteron vs. G5 and Pentium benchmarks. Those results
were terrible
for OS X and not particularly good for the G5 (970) chip. href="g5.html">For example, my 2.7 pound Pentium-M Linux laptop is
faster than my 44 pound G5 running OS X. The floating point
performance of the 970 chip leaves much to be desired, but OS X makes
the performance problem significantly worse.

Given these results, href="http://www.osxbook.com/book/bonus/misc/linux/">this spoof of
Apple’s marketing campaign on a website which helps users install
Linux is fitting:


The Intel chip… For months, it’s been trapped inside a Mac, inside a
pretty little box, dutifully performing pretty little tasks when it
could have been doing so much more. Starting today, the Intel chip
will be set free, and get to live life in a Mac… running
Linux. Imagine the possibilities.

Background

People often ask me about my opinion of href="http://www.apple.com/macosx/">Apple’s OS X both as an
alternative to Linux and as an
operating system useful for statistical computing. Because I support
my statistical
software
on various platforms, I have to think about the
idiosyncrasies of various operating systems and chips. In order to
save time repeating the same information to many people, I have
decided to post it on the web. The short answer: use Linux if you
want performance and stability. If you want to use Mac OS X or
Windows XP, go ahead. All of these operating systems are now above
the line (not long ago the operating systems out of Redmond and
Cupertino were a joke). However, if you decide to use Mac OS X for
whatever reason, don’t assume that it is just like Linux or some other
efficient unix but with a friendly GUI. Life is full of tradeoffs and
reasonable people can decide to make different choices. Don’t pretend
that tradeoffs don’t exist, and don’t fall victim to Apple’s marketing
which is an extension of the href="http://www.folklore.org/StoryView.py?project=Macintosh&story=Reality_Distortion_Field.txt">Steve
Jobs Reality Distortion Field.

Benchmarks

I present here a set of benchmarks which are relevant to my work and
to people working in statistical computing, particular people using
the R Project for Statistical
Computing
. These benchmarks are floating point bound where the
main IO is to memory and not to disk. Cache and Translation
Look-aside Buffer (TLB) misses really matter as well as memory speed.
This setup may be of more general interest. But they may not be
relevant for what you do. If you need a computer to do Y, and
these benchmarks are in no way related to Y, don’t write me to
complain about it. These benchmarks are useful for the work I
and some other computational statistics people do.

OS X is incredibly slow by design in part because of the href="http://en.wikipedia.org/wiki/XNU">hybrid XNU kernel it uses.
It is based on the href="http://en.wikipedia.org/wiki/Mach_kernel">Mach Microkernel
(see href="http://people.fluidsignal.com/~luferbu/misc/Linus_vs_Tanenbaum.html">Linus
vs. Tanenbaum) and the excellent href="http://en.wikipedia.org/wiki/Bsd">Berkeley Standard Distribution
(BSD) kernel. The hybrid kernel is very inefficient and less
stable than alternatives such as the Linux kernel and the BSD kernel
found in FreeBSD. The reasons
for this are many. For example, in Linux, the variables for a system
call are passed directly using the register file. In OS X, they are
packed up in a memory buffer, passed to a variety of places, and the
results are then passed back using another memory buffer before the
results are written back to the register file. You can just imagine
what that does for TLB and cache hits. This just adds to the context
switching difficulties on some chips such as the
href="http://www-1.ibm.com/servers/eserver/pseries/hardware/whitepapers/power4.html">Power4.
Memory management in OS X is awful. To quote href="http://www.tacc.utexas.edu/~kgoto/">Kazushige Goto talking
about his BLAS:
“Performance is suppressed on purpose due to [the] awful memory
management of OS X”. Goto’s work is described and praised on href="http://www.apple.com/education/science/profiles/vatech/optimization.html">Apple’s
own website because he added a custom BLAS for the Apple super
computer at Virginia
Tech
. On the Apple site it states that Goto was “pulling out
incredible efficiencies”. Well, given the Goto’s own benchmarks and
comments, this is just another example of the href="http://www.folklore.org/StoryView.py?project=Macintosh&story=Reality_Distortion_Field.txt">Steve
Jobs Reality Distortion Field.

The benchmarks presented here are based on two of my statistical
software packages for R: href="../matching">Matching (Multivariate and Propensity Score
Matching Software) and rgenoud (R Version of
GENetic Optimization Using Derivatives). The code uses C++ code
extensively. The two benchmark scripts are available href="GenMatch.R">here (Genetic Matching) and href="matching.R">here (Matching). All benchmarks were done using
R-2.3 and gcc 4. The best timing result of the three calls to href="../Matching/GenMatch.html">GenMatch in the GenMatch href="GenMatch.R">script are presented and the best result of
three consecutive runs of the matching script
are presented (examining the worst or the average times yields the
same substantive results).

The machines are:


























Label OS and Chip
OS X Core Duo href="http://www.apple.com/macosx/tiger">Tiger on href="http://www.apple.com/macbookpro">MacBookpro, Intel 2.16GHz
Dual Core 2GB RAM
Linux Core Duo href="http://www.ubuntu.com/">Ubuntu Linux href=http://www.mactel-linux.org/wiki/Main_Page>LiveCD on
MacBookpro, Intel 2.16GHz Dual Core 2GB RAM. Note: Xorg
server running with GNOME
XP Core Duo Windows XP SP2 on MacBookpro, Intel 2.16GHz
Dual Core 2GB RAM.
Linux P4 Ubuntu
Linux ( href="http://www.ubuntu.com/testing/dapperbeta?highlight=%28beta%29">Drapper
Drake Beta 2) on 3GHz Pentium 4, 2GB RAM. Note: href="http://en.opensuse.org/Xgl">Xgl+compiz running with href="http://www.kde.org">KDE
Linux Opteron href="http://www.ubuntu.com/">Ubuntu Linux (64bit) on href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_8825,00.html">Opteron
250, 4GB RAM Note: Xorg server running with href="http://www.kde.org">KDE

GenMatch
Both Linux and Windows XP are vastly faster than OS X: more than
twice as fast. And Linux is somewhat faster than Windows XP.

This benchmark does not take up much RAM, less than 30meg, nor does it
work the filesystem much. But the application does flip between
various shared libraries and pass various data objects back and forth
in RAM. The following benchmark takes about the same amount of RAM,
but unlike the previous one it does not flip between various shared
libraries. It does call a shared library, but it only does it once
and only passes results back once.
matching2
This second benchmarks looks better for OS X, but it is still
about 1.2 times slower than Linux. And the gap between Linux and
Windows has grown from about 5 to about 10 percent.

These benchmarks do not use a graphical user interface. They are
batch jobs run from the command line and produce no graphical
output.
No X11 or Aqua calls are made. And on all platforms the
benchmark process obtains 99%+ of a cpu or core. Moreover, in neither
benchmark are we testing IO or running multiple processes on the same
chip. If we do either of these, the href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_8825,00.html">Opteron’s
relative performance improves.

Many people commented that my previous
benchmarks
, which compared OS X on the G5 with Linux on Opteron
chips, were limited because gcc is optimized for the x86 family. In
these benchmarks, this excuse can obvious not be used. There are some
serious issues with OS X and the gang in Cupertino should get to work.
Even Windows XP performs better than OS X, which is embarrassing for
Apple and a testament to Microsoft engineering given the legacy
software requirements of Windows.

As noted before, the hybrid
XNU kernel
is probably to blame for OS X’s problems. href="http://www.applematters.com/index.php/section/comments/how-long-will-apple-keep-the-mach-microkernel/">People
on the web have recently been speculating whether Apple with drop
the Mach micro-kernel portion of XNU. These rumors have picked with
the departure of href="http://en.wikipedia.org/wiki/Avie_Tevanian">Avie Tevanian,
an important figure in the development of the Mach Kernel first at
Carnegie Mellon and then at Apple. Interestingly, Chris Emura, the
Filesystem Development Manager within Apple’s CoreOS organization, href="http://www.osnews.com/story.php?news_id=14473">recently
stated that Apple is interested in porting href="http://www.opensolaris.org/os/community/zfs/">Sun’s ZFS
filesystem to OS X. If true, it may be that Apple is interested
in fixing core issues with their operating system now that the eye
candy is stable.

I have conducted many more benchmarks on these and other machines.
For example, I have tested the HFS+ filesystem. It is slower than href="http://www.namesys.com/">reiser especially for small and
medium sized files and slower than href="http://oss.sgi.com/projects/xfs/">XFS especially for large
files. If you want these additional benchmarks, let me know.

There are claims on the web that when Apple developers compile OS X on the 970, they use -Os. That is, they optimize for size and not for performance. “So even though
Apple talked a lot of smack about having a first-class 64-bit RISC workstation
chip under the hood of their towers, in the end they were more concerned about
OS X’s bulging memory requirements than they were about The Snappy(TM).”

AnandTech has an article which offers another explanation for why OS X is so
inefficient. See href="http://www.anandtech.com/mac/showdoc.aspx?i=2436">No more mysteries:
Apple’s G5 versus x86, Mac OS X versus Linux.

A writeup of my previous benchmarks, which includes a review of my general impressions of OS X, is available here.

Suggestions

If you have any suggestions on how to fix the terrible performance of
(this software on) OS X or if you think something here is erroneous,
please contact me.

Links

See similar benchmarks available on AnandTech’s website: href="http://www.anandtech.com/mac/showdoc.aspx?i=2436">“No more
mysteries: Apple’s G5 versus x86, Mac OS X versus Linux” and href="http://www.anandtech.com/mac/showdoc.aspx?i=2520&p=8">“No more
mysteries, part two”.

For another review see When a Linux user buys
Apple’s Mac mini
.

HOME

19 Responses to “Linux trumps OS X”

  1. Reader's Write Says:

    This comparison is retarded. You are comparing an OS that concentrates on usability (OS X) against a server OS that is basically useless for the vast majority of people (Linux). OS X is far and away a faster operating system if you compare your ability to actually get work done on it versus spending days recompiling your kernel and trying to get your video card to work on Linux. In addition, OS X is a professionally written operating system that has fully qualified and fully paid domestic programmers backing it up, with a corporation that is on the cutting edge of the industry. Why you would want to give all that up for a silly benchmark against a toy operating system like Linux is beyond me.

  2. Reader's Write Says:

    OS X SOX

  3. Reader's Write Says:

    toy operating system my ass. recompiling your kernel for a video card? when was the last time you used linux? 3+ years ago? not to be a dick but you have no idea what your talking about. unless your running some hyperspecialized, very very rare, really outdated or really really new devices, linux should be able to do it all. there are exceptions, especially when companies don’t want to play nice with linux. same holds true for Mac though, i walk down the aisles of computer stores and alot of what i see doesn’t have drivers for mac, or wouldn’t work on one.

  4. Reader's Write Says:

    Oh dear. Somebody touched a nerve didn’t they. Okay Linux requires some specialised knowledge to administer, but can be set up to be an easily usable system.

    Windows XP, however, which out performs OSX on these tests doesn’t really. It is as user friendly as OSX, just works in a different way. So your stylish OS isn’t as fast as others. Get over it. If you’re one of the magpies who prefers shiny things over speed you haven’t really got a problem have you?

  5. Reader's Write Says:

    >>This comparison is retarded. You are comparing an OS that concentrates >>on usability (OS X) against a server OS that is basically useless for the >>vast majority of people (Linux)

    (1) Linux can be anything you want it to be. May it be a server or desktop. It all depends on what software you install and how you configure it.

    (2) The guy in this article used ubuntu (according to the linux link atleast). Ubuntu installs X and gnome by default, which together form a complete desktop environment, very much like windows or OS X, except of course it is open source and uses the GNU General Public Licence. If i may comment on gnome itself, i can say with certainty that it’s very usable, even to the novice user.

    >>OS X is far and away a faster operating system if you compare your >>ability to actually get work done on it versus spending days recompiling >>your kernel and trying to get your video card to work on Linux

    I can install my video drivers and auto configure my system to use them in one line in the console (assuming a debian/ubuntu distro):

    sudo apt-get install nvidia-glx && sudo apt-get install nvidia-settings && sudo nvidia-glx-config enable

    That automatically downloads/installs/configures the nvidia video driver. No hunting around for cd’s/websites to find the correct drivers.

    By the way, video drivers don’t require recompiling of the kernel. Infact the only time i needed to compile a linux kernel was when i was install gentoo, in which compiling of the kernel is part of the install process. Note, gentoo is an advanced linux distro, it’s not designed with novice in mind.

    >>OS X is a professionally written operating system that has fully qualified >>and fully paid domestic programmers backing it up, with a corporation >>that is on the cutting edge of the industry. Why you would want to give >>all that up for a silly benchmark against a toy operating system like >>Linux is beyond me.

    (1) Closed source programs are usually a poorer quality than that of open source software. The reason for this is that, open source applications will undergo a higher degree of inspection and critism from peer review (potentially thousands of other programmers viewing/improving the code around the globe). Under this kind of scrutiny, many flaws and bad practises will be removed/revised and rewritten.

    Consequently, patches for bugs and flaws are implemented/deployed much faster, unlike with propriotory software, in which seriously problems are not fixed for a long time.

    Also, programmers who are getting paid are usually just doing it for the money. Alot of the open source work is done for interest and thirst for knowlege in the subject matter, which means alot more innovation occurs.

    (2) Saying linux is a toy operating system is also saying the same about OS X as they both are historically derived from the same source OS, and that is unix.

    You only have to take a quick peak at the GNU/Linux webserver numbers to see that the internet is built on linux systems. The rationale behind this is simple, it’s the most stable, efficient, and versatile OS available.

  6. Reader's Write Says:

    Forgot to note that the performance would have been better without using X on ubuntu. There are far less processes running without an X session running, consequently, the system would beable to devote more resources to the task in question.

    Does OS X/Windoze XP have this option?

  7. Reader's Write Says:

    sudo apt-get install nvidia-glx && sudo apt-get install nvidia-settings && sudo nvidia-glx-config enable ?????

    I’m just a dumb Mac user… Who likes the speed and transparency of my OS X. Why the hell would I want to learn,

    sudo apt-get install nvidia-glx && sudo apt-get install nvidia-settings && sudo nvidia-glx-config enable

    It’s all computer geek gobbledy gook to me.

    Get the picture GEEK!!

  8. Reader's Write Says:

    It’s pasting one line into a console compared with hunting down the drivers then installing manually. One command line seems easy to me :)

    There is nothing complex about it. sudo means to elevate your privilages to root (for security reasons!). apt-get is the package management tool to install/remove packages. && just concatenates multiple commands on a single line.

    There you are, now you know debian package management, wasn’t so hard was it?

  9. Reader's Write Says:

    … trying to get my Mini to print to an Airport Extreme?

    The Windoze box and the Linux box work just fine. The Mini freezes halfway into the second page. And this is after all the BS I went through fixing permissions and other stuff *from the command line* in single-user mode to try to fix the freezing and spinning beach ball of death. OS X is considerably less stable than my other machines. But yes, it looks great.

    Macs are very nice, but you’re just spouting 3-year-old ignorance when you talk about recompiling a kernel or having trouble getting a video driver to work. Ubuntu took about 20 minutes to install and configure on this machine. Tiger took about 40 minutes on my Mini. You don’t have a point to stand on.

    I use the Mini for sound and video editing; my wife and son use it for word processing and web browsing. I use the Linux machine for work (programming) and browsing the web. I use the Windows machine for things like my son’s Lego Mindstorms.

    OS X is fast for some things, slow for others. The point of this article is that OS X is ridiculously slow for some things. If you don’t care about those things, then what are you doing here complaining?

  10. Reader's Write Says:

    “…against a toy operating system like Linux is beyond me.”

    After reading that statement, my opinion that you don’t know anything was verified.

  11. Reader's Write Says:

    Those who think “Linux is a toy operating system” need to educate themselves, as proved they are ignorant living in the darkness!!! Microsoft ranks Linux Enemy number 1, because it’s threatening their business and existence.

    : )

  12. Reader's Write Says:

    If you’re just a dumb mac user, what are you doing reading an article about statistical super-computing? Whether or not OS X is more newbie-friendly is immaterial to the issue at hand. The issue is that if you want to do any kind of large-scale computational work with OS X (which doesn’t use any of the fancy features you mention) then you’re really just wasting your money. It also indicates that the real speed and efficiency of OS X is fairly poor and to get equal performance with windows would require quite a bit more hardware. So it appears that for scientific computing, OS X is just a toy operating system. Linux on the other hand, is a work horse. Almost all supercomputing clusters run Linux these days. Windows is gaining ground here too. But dispite the Xserve and Xserve cluster node, Apple will probably never make serious inroads in this area. This is okay, since Apple is first and foremost a consumer-oriented company. Whereas Micrsoft and Linux are aimed more at general-purpose and business-oriented computing and servers.

  13. Reader's Write Says:

    If apt-get is too hard for you, there are programs like aptitude. There is one that’s pseudo-graphical, and another that’s fully-graphical. So, you don’t have to use the command-line to install software if you don’t want to. You still don’t have to hunt down the drivers and software you want. The graphical package manager, last time i checked, installed on Ubuntu by default, so it’s there the moment you install…

    Now, I’m not going to say that all Linux systems are usable by the average person. I certainly don’t set up my own machine in a way that most people would find user-friendly. However, if you haven’t tried Ubuntu, you should really give it a try. You might actually like it. It’s very nice, and most things just work out of the box.

  14. Reader's Write Says:

    “if you compare your ability to actually get work done on it versus spending days recompiling your kernel and trying to get your video card to work on Linux. ”

    Others have already commented on your lack of understanding with regard to video drivers and such. I would like to let an Apple owner and fan, Kevin Rose, disprove your point of “getting work done.” Watch Diggnation and you’ll hear him repeatedly say that he cannot connect to the wireless because his apple has issues.

    Then there is the overheating issue that apple has yet to fix but others have already done so by properly applying heatsink grease.

    Conversely, my HP 2000 (sub $900 system with a 14in screen) loaded Ubuntu in under 30mins and I had wireless working in another 10. Since it came stock with XP that means I can connect via two different os’ to any wireless sysem I need and get my work done faster. IMHO, time is money and having connectivity issues costs me money.

    Nothing makes me want to avoid puchasing apple products faster then legions of fans who avoid facts. And just to prove my point, XP is horrible at security compared to Ubuntu. Ubuntu on the other doesn’t run some of the games I own.

    See, I can be honest about my purchase and still enjoy using it.

    Regards

  15. Reader's Write Says:

    Whenever I see references to things like RDF, etc. in an article, it’s pretty clear that there is a strong anti-Apple bias. Jasjeet Sekhon pontificates about things he clearly doesn’t understand. Please Jasjeet, spare us the false claims you make with regard to kernel theory. You’re out of your league.

    If anyone is actually interested in an analysis that also demonstrates how off base Jasjeet is, look here: http://ridiculousfish.com/blog/archives/2006/05/16/36/

    So Jasjeet, while trying to come off as some sort of cross platform expert, all you’ve demonstrated is that don’t know the first thing about performance tuning or kernel theory for that matter. I’d suggest you stick to political science as your skills in computer science are lacking.

    Steve

  16. Reader's Write Says:

    It’s actually not that bad considering how long each operating system has existed on the Intel architecture.

    I was assume that over time all of these operating systems would become more efficient on similar hardware.

  17. Reader's Write Says:

    Well for me OSX is faster in some areas, but slower then others. In bootup I find OSX quite a bit faster then Linux but like Windows XP once you log in and start up the system then things go down.
    Actually there were one or two times where i found XP faster then Linux or OSX, but once you bog it down with software that takes up room on the system tray then you meet the sluggishness that I hate so much out of XP.
    Linux, or at least all the mepis varients I have tried are not so good on bootup but after the login screen it gets into both KDE and gnome like a racecar.
    But it really depends on setup really.

  18. Reader's Write Says:

    I have to agree with you, Ubuntu made totally useable = Mepis.
    Ubuntu is a great distro, but I find Mepis (www.mepis.org) based off Ubuntu to really be the best of the best.
    As for the results in the article, in my experience in just plain overall computer usage, the results are Mepis (fastest), XP, then OSX (slowest). Your mileage may vary….

  19. Linux Trumps OS X and Still Trumps « alll about linux Says:

    [...] Linux Trumps OS X  [...]

Leave a Reply

Please no Spam, flaming (attacking others), trolling, and posting off-topic. Thanks.

    Advertisements
MP3Rocket


Remove Spyware with AntiSpyware for Windows®