Making Operating Systems Faster 667
mbrowling writes "In an article over at kernelthread.com Amit Singh discusses 'Ten Things Apple Did To Make Mac OS X Faster'. The theme seems to be that since you won't run into 'earth-shattering algorithmic breakthroughs' in every OS releases, what're you gonna do to bump your performance numbers higher? Although the example used is OS X, the article points out that Windows uses the same approach."
Faster? (Score:4, Interesting)
One word: (Score:5, Interesting)
Largest bottleneck in any modern system. If you've never had the opportunity to use a 15krpm (or something faster) system, do it now. It flies... I don't care if it is Windows or what... it doesn't matter when you've got usable bandwidth to the biggest chunk of storage out there.
Re:#1 thing Apple should do... (Score:4, Interesting)
OS designers shoudl also cut down with bloatware and trying to 'integrate' everything into the OS...
Haven't read the article yet .. (Score:3, Interesting)
I haven't looked into it for a while (mod me down for being uncertain if you like), but I seem to recall that there were serious leaps and bounds still left in OSX performance, with a change to the ABI register use, potentially, in the future
Re:One word: (Score:0, Interesting)
Speed Improvements on Old Hardware (Score:5, Interesting)
And the fact that I won't be discouraged from keeping 10.3 or 10.4 on that system if the next version doesn't support my hardware through annoying EULAs.
Hello? Linux, are you there? (Score:5, Interesting)
Aparently, windows caches a bunch of stuff and has a bunch other little hacks that allows this. So why can't linux and the kde people do this. They've copied everything else, why not this?
Before you mod me as flamebait or troll, I switched over to linux a while ago and I have no intention on going back to windows. I'm not some ms fanboy bitching about my 10 minute experience with linux. All I'm saying is that here are some points where linux annoys me.
Prebinding not all good (Score:5, Interesting)
Apple, and other system vendors need to consider these types of management issues when making a change. Speed improvements are only good if they are "management friendly"
um, no (Score:3, Interesting)
That's 2 words. (Score:5, Interesting)
My 2 words are RAM DRIVE. You think you can't justify 4Gb of RAM? Course you can.
Dedicate 2-3Gb of it to a ram drive and mount it as your root,
The difference in performance can be stunning.
Re:One word: (Score:5, Interesting)
faster use of preference files: TtoF (Score:5, Interesting)
The earliest versions of the software did not convert key preference/calibration/setup files into internally stored numerical values -- instead, anytime the code needed a calibration/setup value, it went to the file, read it, and converted it. Needless to say, that "feature" was quickly corrected.
That's not as bad as an early VAX image processing program that prepped newly allocated file space by setting all the bytes to zero, one byte at a time.
Re:One word: (Score:1, Interesting)
What went wrong on the software level that systems now take so long to boot? Are it generic kernels that probe for a lot of non existing hardware and thus basically just spend their time waiting for timeouts? Or is it todays software with all its dynamic linking and its dependecy (heard the slowness of KDE was in most part a fault of ld.so)? Or is it just bad organisation of boot scripts, ie. lack of paralelims while starting them, useless stuff first, so that the important stuff has to wait and such?
depends on the distro (Score:3, Interesting)
So, I know what you mean. And I've even noticed the same thing when trying ootb installs of mandrake 7,8,9,10, redhat 6,7 etc. on my 1600 athlon xp.
Until I tried SuSE 9.1. I'm not a fan of kde but this distro looks really nice and it feels snappy in a way I've never known from linux in the half dozen or so commercial distros I've tried over the years. Between the snappy desktop, the eye candy and yast, it sets a REALLY high bar for every other desktop. You might give it a try and see if you don't agree.
And no, I don't work for novell...
Re:Missing Step (Score:4, Interesting)
I'll simplify the comparison quiter a bit, but I think Apple decided to trade speed for distinguishing features. It must've worked, because people noticed.
Re:One word: (Score:2, Interesting)
I'm curious. Why do you say that is SCSI fickle?
I remember a time when one had to be careful not to exceed the a certain cable length when daisy-chaining external devices, but other than that SCSI has been nothing but rock-solid on my systems.
As far as the performance goes, you're absolutely right. I've got a RAID5 array of four 10 krpm U320-SCSI drives on my dual Opteron. It was almost scary to watch how fast it compiled stuff during Gentoo stage 1 installation. ;-)
Re:Entire OS on RAM drive (Score:3, Interesting)
c) Have a shutdown script that will always run on shutdown. From what I understand, Windows has more then one shutdown (there's at least 2: the "slow" shutdown you get from Start -> Shutdown, and the "fast" shutdown you get from pushing the soft power button on your case).
What a surprise- MS does the same stuff, but... (Score:1, Interesting)
Every revision of OS X has run (or at least "felt") faster than its predecessor did on the same hardware. Panther will run fine on a five year-old G4, assuming you've added RAM to what the machine shipped with in 1999.
You absolutely cannot say that about Windows. Nobody sane would even consider trying to run XP on a PC they bought new in 1999. One of Microsoft's growing problems is that people are getting off the upgrade treadmill-- they've begun to REFUSE to upgrade to version n+1 because they know their computer will feel slower than it does with version n.
I've got a 733MHz G4 running OS X 10.2.8, and a home built (with *quality* parts) Athlon XP 2600 system running XP, and there's no comparison... the XP box feels terribly slower, even heavily optimized with all the XP eye candy shit turned off, unneeded services disabled and spyware, etc ruthlessly prevented/exterminated. OS X running on a machine with 1/3 of the horsepower thoroughly embarasses it in terms of user-perceived speed. That's just plain pathetic.
Opinion from an ex-microsoftie (Score:3, Interesting)
Looking elsewhere (Score:5, Interesting)
Try running Windows NT on a new Intel system (say 2-3GHz) for example - it'll run blazingly fast, and with software versions from around the same time it'll still do much of what everyone wants to do - email, web, office, graphics manipulation - but really much faster - things will load practically instantly, rather than after five or ten seconds, and it's all still nice and graphical and everything, just like people want.
Many (but not all) XP machines I meet still seem to take 2-10 seconds even to do basic things such as open My Computer, Internet Explorer or a properties dialog, which one has to wonder is worth the wait for the extra functionality - basically lots of drivers, a couple of extra bundled programs and supported file formats, minor changes to the interface and the other couple of things I'll get flamed for forgetting. Microsoft have no doubt made some improvements to the kernel between releasing NT and releasing XP, but most still seem to be no faster to use, if not slower.
I maintained a school network up until last year which still ran NT and KDE2 on around 2/3 of systems, and then when my replacement went and wiped everything out and replaced it with new machines running XP (with an enormous cost to them), many staff told me that there were lots of things that didn't work any more, and there'd be frequent outages of the entire network.
On a Linux+X system, running X on its own (i.e. just the one program you want) or with a light window manager (fvwm or whatever) is again noticeably faster than running Gnome or KDE. Loading Mozilla or OpenOffice.org means loading the entire frameworks they run in, and often we're loading up a great deal of functionality we don't want in that particular situation. I think a good example is Dillo [dillo.org], a web browser written entirely in C that just does the basics (launches in around 0.7 seconds on this Athlon 700 system, compared to Mozilla, which takes around 5, and Mozilla Firefox, which isn't far off that) - it'd be interesting to see if they could add things like CSS or SSL support and still keep it fast.
Re:One word: (Score:5, Interesting)
5400 RPM 11 ms
7200 RPM 8 ms
10K RPM 5 ms
15K RPM 4 ms
Name another common mechanical device that has nearly tripled in speed in that period. (Source: seagate.com, all numbers are for 3.5" disks)
Re:Hello? Linux, are you there? (Score:5, Interesting)
The case of mshtml.dll, shdocvw.dll, urlmon.dll are a little different. These are *system DLLs* which can be used by any app, including IE (iexplore.exe) -- and the shell (explorer.exe). Explorer in particular will load urlmon if you visit FTP or WebDAV sites.
IIRC after login on a fresh Windows 2000 install, none of mshtml, shdocvw or urlmon are loaded.
Note that Working Set Detection/Maintenance on Windows can change this over time, but it will do so even for Firefox or any other non-MS app.
Btw, the real reason IE and Office start up quickly is because they are better engineered that the competition -- which is typically cross-platform portable code that is not particularly optimized for Windows. Reducing startup time is not necessarily a black art:
The true measure is how fast the app runs, not how fast it opens.
Not sure what your point is, but Open Office and Mozilla both run slower (_and_ open slower) than Office and IE on comparable hardware. Thankfully, Firefox opens slower than IE, but is almost as fast in use for most common tasks, which lets me use it for day-to-day browsing.
FS Journaling (Score:4, Interesting)
In fact, journaled filesystems are generally noticeably (one might say significantly) slower than non-journaled ones.
The only 'performance' gain one gets from journaling is after an unclean dismount (a crash or power outage). The system will boot up much quicker, but that's it.
Windows... (Score:1, Interesting)
One of the reasons I dont use Linux as my desktop is the office packages. Under windows, I can type ctrl+alt+w (My shortcut for MS Word) and it starts INSTANTLY! Not 5 or 10 seconds, like OpenOffice. Call it bloated or whatever, but it works the way I like.
For example, run any program and look in %windir%\Prefetch - and try run it again and look at the speed difference.
There was a discussion about this on the kernel development mailing list a couple of months ago I think, and the approach used by windows was considered.
I also use Maya a lot, and other operating systems it has been ported to (I havent used IRIX) have problems
with various graphics cards and/or sound. OS X has worse performance than windows for the same price for running Maya as a workstation or a rendernode.
All the eyecandy and other crap is very easy to turn off... things work a lot better on a wider variety of hardware than any other OS. Linux has a lot of driver support, but nowhere near that of Windows still
Re:Missing Step (Score:3, Interesting)
That, and if they made the eyecandy off by default, it would never get turned on by 95% of the users, and so Microsoft's investment in that development is wasted (you could argue its wasted now, and I wouldn't disagree
As it stands, the people who know enough about their computers can find magazine articles & online guides to tweak for performance, and those that don't probably don't know the speed they are missing anyway. And if its getting too slow, they just buy a new computer! Everybody (== Microsoft) wins!
You want fast! (Score:2, Interesting)
To me the ultimate example of this is Damnsmall Linux [damnsmalllinux.org], nothing but lean and mean apps!
If a computer is 10x more powerful then it was 7 years ago it should be doing 10x the amount of work, instead we get more and more eye candy.
Re:How I would improve the speed of the system... (Score:4, Interesting)
Application memory space during runtime? 15MB.
I remember when Borland spend a lot of effort to optimize their Quattro Pro spreadsheet so that it was monitoring it's own memory usage down to 512 byte increments. It would start discarding portions of itself that it no longer needed.
Those days are over, for sure.
Re:#1 thing Apple should do... (Score:5, Interesting)
Ugh I hate this question. "Is it really necessary?"... is the type of question you can ask if you really want to make anything go away. "Is a >500mhz processor really necessary? Is a color monitor really necessary? Is being connected to the net 24/7 really necessary? Is a color printer really necessary when B&W is cheaper?" Who really cares so long as you can choose?
I'll answer your question, though: The more your UI gives you, the better reflexes you can build while using your machine. Have you ever reacted to a screen refresh? (Particularly in the olden days when the CPU had to fight harder...) Ever notice change in window focus simply by spotting the change in titlebar color? Etc.
I have no problem with people turning the fancy stuff off to boost performance, but the "is it really necessary" argument does not apply. The question is really "Do I want it?"
Re:That's 2 words. (Score:1, Interesting)
So I had a boot script to load a teeny root disk (25MB, for X & xmms) then cram the rest of memoy to the brim with music.
Combined with a fanless VIA epia, it's a noiseless (less than 0dB) pc based hi-fi.
Now I've got a quiet enough maxtor disk, thus mooting the whole project, but it's no longer "noiseless". I'm just waiting for 80G of Ram on a passively cooled amd-64...
--
Laurence Darby
btw I'm ac cos usually I only lurk here
OS/2 Warp (Score:4, Interesting)
Apple II series rules on boot-up times (Score:5, Interesting)
2. Press Ctrl+break (? it's been a looong time since I used one).
3. You're done.
It takes under 2 seconds. Show me a "new" machine (see: desktop,server or notebook from the last 5 years) that actually boots that fast, please! (not just turns on the monitor)
Re:#1 thing Apple should do... (Score:3, Interesting)
That's going to scare away non-technical users though.
MS, love 'em or hate 'em, is doing it right: appeal to the largest market segment with the default settings. Those people who want to improve performance are still be able to, but need to make the adjustments post-install.
Re:Haven't read the article yet .. (Score:3, Interesting)
But then the OS is 'doing less' too, so that's not really a good comparison. Linux GUI's are not as advanced as OS X at this point. They don't use a display postcript like system yet, don't yet have the same level of integration in terms of plugable software frameworks, etc etc
This is separate from AltiVec, which is an instruction set, not just a register setup
I'm still not really clear how it's different from AltiVec since you could easily build binaries using diferent registers as well. But then I don't have all the details either. It could well be true I suppose. Not sure why the ABI would require that binaries not use some registers, seems weird.
Re:Windows... (Score:2, Interesting)
No, it only seems like it starts instantly because half of the shit it needs loaded got loaded at boot time and just sat there wasting resources until you decided to launch Word.
I don't know about you, but my PC is no slouch hardware-wise and is very well-maintained software-wise, but it still takes an infuriatingly long time between the desktop, icons, and mouse cursor appearing (i.e. looking like it's ready for me to use it) and the computer actually being ready for me to use it.
Sleep vs Hibernate (Score:3, Interesting)
Apple computers do not hibernate. Rather, when they "sleep", enough devices (in particular, the dynamic RAM) are kept alive (at the cost of some battery life, if the computer is running on battery power). Consequently, upon wakeup, the user perceives instant-on behavior: a very desirable effect.
I don't know how they can be proud of not hibernating. Windows can sleep OR hibernate. Although being a Mac household, hibernation is one reason I MIGHT consider windows for my next laptop. The ability to get back to all you have left around with your laptop hibernating for a few days unplugged and still have full battery power when you open it up is VERY nice.
Re:#1 thing Apple should do... (Score:3, Interesting)
For a comparison you can run X with fvwm in (not in rootless mode) on MacOS X and see the difference. Or turn on terminal transparency and wiggle the terminal and watch the whole computer slow to a crawl.
That is the real reason OS X seems to go faster on slower computers with each release. On faster computers, I forget what it's called, but they pipe Aqua through the video card to take away the overhead, which is a major optimization. I don't think, by comparison, that any of the other effects they mention in the article count for much in terms of between-release improvements.
Re:Hello? Linux, are you there? (Score:5, Interesting)
Some efforts have been going into making KDE and KDE applications start up faster. Just the same, if it bothers you that much, don't run KDE or KDE applications. There are many window managers to pick from. Even GTK+ applications tend to load much faster than KDE applications (C versus C++, which is the root of one of the speed issues).
The overall performance of X and Linux will be faster and more responsive as the 2.6 kernel starts to become more common. A typical desktop user should see something like 20%-40% better performance and responsiveness. Even servers typically see 20%-30% improvement in almost all areas. Improvements like these, make applications like apache and samba, which already blew the doors off of Windows, that much more impressive.
Beyond that, start up time, in my mind, is a complete waste of time. Unlike Windows, Linux does not become unstable as you load more applications into memory. Start your computer and all of your applications (memory is cheap; tuning you swappiness as needed) and never have to load them again. I find that application crashes are rare; well, the ones I run. This means, rarely needing to restart your applications. As such, restart time is lost in noise. Furthermore, system stability can easily be measured in months or years as long as you're not running a closed source 3rd party driver (*cough* nvidia, ati).
Long story short, while I hear you and think you have a valid point, the long of it is, it's completely lost in the noise and really doesn't matter.
Re:What a surprise- MS does the same stuff, but... (Score:1, Interesting)
Eventually they fixed the problems. Windows did not have that problem to being with so it's "speed increases" are not as huge.
OSX only became a real OS release with the release of
(I won't even go into it's original lack of color management, printing, and file handling mechanisms that made OS X such a publishing favorite to being with!)
Re:I've got one word for you... (Score:3, Interesting)
I have always found Mandrake to be very slow. I started with Mandrake 7 or so. I recently tried the previous (9.x) release before 10 and still found it to be unbearably slow.
That being said, I still say that that is the best distro for someone to start with. I have since moved on to Gentoo. My linux install blows away anything else I have used in respect to speed however I still use XP quite a bit (though not as much since i got by powerbook.) I would suggest putting a new partition on your machine and giving gentoo a shot. The install is a little difficult but you'll learn so much about how to administer your machine through the install.
I'm sure mandrake could be sped up a little but I'm not the person to ask. I think a lot of it it boils down to getting the correct drivers for your hardware, especially your video card and getting read of services that you don't need or want.
Re:XP and OS X difference (Score:4, Interesting)
Microsoft tends to spend more time figuring out ways to trick their users into *thinking* that things are faster even though it's actually taking as long, if not longer than previous versions. In this case, you've been tricked. Microsoft moved more stuff after the user is logged on. In other words, your system is still doing all of the things it used to do, plus probably more, it's just that you think it's done.
This is the difference between reality and perception. Microsoft tries very hard to address a user's perception, even at the cost of making reality slower. As is, in the above cited example, Microsoft gave you a login screen, whereby, you can do very little to nothing, but you're satisified thinking it's done, in spite of the fact (reality) that it's not. This means, attempting to do things right after the login screen will more than likely, take much longer than expected. They further hide this fact by making application startup and caching part of the OS boot sequence. Non-cached application startup, following initial login, will more than likely be painfully slow for non-trvial applications, at least until XP actually finishes it's startup.
Good or bad, you decide.
Prebinding is worst misfeature of MacOS X (Score:5, Interesting)
I don't understand why it doesn't just leave the prebinding to be done the first time the program is run.
Re:#1 thing Apple should do... (Score:5, Interesting)
The reason X runs slowly compared to Aqua is that Apple optimizes Aqua and allows harware acceleration (Quartz Extreme) and offloads lots of tasks to the GPU. I know of no X windowing system (aside from Apple's own implementation) that does this in OS X.
10.0 and 10.1 were dog-slow. Especially when you had a couple of hundred files in a folder. Jaguar was a huge increase in speed and performance. Quite a bit of that was due to the Quartz Extreme, but even my lowly 500MHz dual-USB iBook saw quite a boost from Jaguar and it was not able to use QE at all. Panther did very little to the iBook, except make it take forever to boot. I need to check on that bootcache issue.
My dual 800MHz Quicksilver is now almost three years old and I am still very happy with its performance. I expected to be wanting to replace it after two years, or after clock speeds have doubled, which is what I did when I used Wintel systems. Instead, I am considering keeping it around for the 10.4 release and at least another year or two. I attribute quite a bit of this to Apple's tweaks and performance enhancements of the OS.
Re:Am I Supposed To Be Impressed By Apple? (Score:5, Interesting)
IMHO, the next major revolution in OS design (and performance) will be from an exokernel [mit.edu] architecture. For those who aren't familiar with them, it's a completely radical and different approach to kernel design, the main idea behind it is seperate protection from management. If you really think about it, who (I use that term loosely) would know better what resources, scheduling, etc an application will need - the kernel, or the application itself.
Traditional kernel design techniques give the (pretty much) the entire management of resources to the kernel itself and hide it behind a HAL (hardware abstraction layer), allowing the application little to zero say in the matter. Exokernels throw that idea out of the window, taking a completely opposite view on the issue. Once you give the power to the application, it opens a whole new world of OS design.
It's really quite interesting, for more information on different kernel designs you can check out the Microkernel entry [thefreedictionary.com] at thefreedictionary.com
Faster boots, and an idea (Score:2, Interesting)
One thing I just remembered that annoys me about the Linux dists that I have used, is that all the startup scripts are executed in sequence, even if they aren't dependent on one another. On my Amiga, I remember I used to have the startup script execute all sorts of things asyncronously in parallel, so that the CPU never idled while waiting on disk.
Maybe Unix-like OSes should do that. I mean, there's no reason /etc/init.d/postfix and /etc/init.d/apache can't run at the same time, so that if one of 'em blocks on some I/O (disk or network or whatever) then the CPU(s) can work on the other one. That would ultimately result in a faster boot.
Sure, there are some dependencies (I guess you want network interfaces started up before servers start binding to ports, for example) but there are ways of dealing with that. Hm.. maybe there's already a tool that sort of handles the complexity of dependencies and can execute things in parallel when appropriate: make. Hmm... Anyone already doing this?
Re:#1 thing Apple should do... (Score:1, Interesting)
Re:Speed Improvements on Old Hardware (Score:1, Interesting)
Fluxbox, for example. =D
Re:Apple II series rules on boot-up times (Score:2, Interesting)
My Handspring Visor has:
8MB ram 8MB flash ram backup
68000 CPU at 25MHz (?)
160x320(?) screen w/ 4 greyscale
My Sony Clie SJ22 has
16MB ram 128MB memory stick
faster 68000 at 33MHz
higher res screen in color
Compare to a Macintosh SE:
68000 cpu at 8MHz
4MB ram
1.4MB floppy
Maybe a 20MB hard drive
512x348(?) screen in black & white
The PDAs are do lots more then the SE. I can get Word & Excel compatibles for the Palm too.
Re:Windows... (Score:1, Interesting)
1. Use a simple program to allocate 2GB and randomly read/write to memory - to prevent it from all being swapped.
2. Run word.
It may not be a very accurate result, I only tried it 3 times, but each time, word started in under 1 second and I could start typing in 2 seconds, and OpenOffice 1.0 took more than 16 seconds before I could start typing.
I think the grandparent has a point.
Re:Prebinding is worst misfeature of MacOS X (Score:3, Interesting)
Why wait? Usually, I just switch to another application and work on something else while the prebinding is going on. The fact that even major installs do not monopolize the computer is one of the things I appreciate about OS X. I certainly want it deferred until the next time I'm in a hurry for that particular application to start up.
Re:Two kinds of speed (Score:3, Interesting)
Try LinuxPPC. Gnome 2.6 really flies on LinuxPPC. Especially compared to Panther. My entire desktop is noticably more responsive under Linux than it is under Panther. On both my Dual 1.25ghz G4 and my crappy 400mhz Pismo Powerbook.
Re:One word: (Score:1, Interesting)
Re:Here's that list trimmed down to just 3 steps (Score:2, Interesting)
My current OS X 10.3 install, plus some additional apps, plus some source tarballs of projects, plus the Xcode enviroment, plus an archive copy of 10.2, is using 10.61 GB of space. The lproj files are not very large. While it is true that you can save space by not installing all the language support, it isn't 10GB of space. Languages can selected/deselected during the initial install.
The poster is correct though, that the granularity of control over install is much rougher than with Gentoo or Debian. Given the target audiences, this shouldn't be surprising.
barebones install? (Score:2, Interesting)
As my operating systems professor says (Score:2, Interesting)
Sad, but true. Though, there really is no excuse for for the iTouch problem, then again there is no reason to spend 6 months trying to fit a word processor into 640K (like they had to in the "old days" my prof likes to talk about so much.) There really must be a happy medium, and I think most apps and OS's are at it.