New clear Objective-C

I have come here to chew bubblegum and write code ... and I'm all out of bubblegum.

Wednesday, January 11, 2006

From Windows to OS X, what is it about dual processors.

Somewhere along the way in the transition from a NeXT Cube to a modern Mac I got stuck on Windows. I am a longtime Objective-C developer and have been using the old YellowBox ProjectBuilder on NT/2000 for way too long. The people who use my software are on Windows, so my stuff needs to run there and I need to develop there. For a bunch of reasons I was unable to use a Mac as my main machine, but things have slowly changed and I can start the transition.

The most significant development recently has been Xcode and target custom build rules. For a long time I have hated makefiles and the pre-Xcode PB using jam files was just as bad. It always annoyed me that a project has all the information it needs to be compiled from the IDE, and yet got compiled in this hugely indirect way via Makefiles. Xcode is now at the point that it can do what I want, sans makefiles, and I am pretty happy about it. So I have started to use Xcode in earnest on a Mac mini in an attempt to transition my work life to a Mac.

At some point in the past I switched from a single processor PC to a dual processor capable PC with one processor, and upgraded my version of WebObjects, I am pretty sure it was 3.51 to 4.0, at the same time. The odd thing I noticed at the time though was that despite the PC being faster, using PB was an exercise in patience. It had become horrible unresponsive while compiling, infact, all the YellowBox apps were really unresponsive when one was being used heavily. This was really only apparent with PB because PB was one of the few apps which was actually under load when the user wasn't using it, compiler and error output mainly, or GDB dumping a long backtrace. I soon added the second processor to my PC and suddenly PB and all the YellowBox apps were so much more responsive. The difference was tremendously dramatic, the apps went from locking up a lot to being extremely usable. I have been using this same machine and WOF 4.5 since without incident.

Jump to 2006. Using the Mini with Xcode is giving me flashbacks to that PC with the single processor. I've had Xcode go to lunch a few times, and when it does the whole system is just horribly unresponsive. Force Quit takes forever to come up, the system event queue seems to drop events like flies as I try to shut some windows and the whole situation just takes way too long to fix. In general, when one app is busy, the system is really bogged down in general. I have a dual G4 (450) which I use for personal stuff and it is just so much more responsive than the Mini despite being a much lower clock speed.

Something about Apple's UI demands a second processor. Granted having two processors is almost a doubling in performance, but so should a leap from 450Mhz to 1.4Ghz and it just doesn't happen when it comes down to responsiveness. Scheduling, priorities, something is not tuned enough to user interaction.

So until I have a dual processor machine, or all Mac's are dual processor. I am wishing for some sort of high priority key strokes. Hate to say it, but ctrl-alt-del is really nice to have on a very busy Windows machine, the task manager comes right up and I can terminate an offending program.

And I want the sound volume/mute keys high priority too. When Corey Taylor is screaming his brains out at volume 10, I'm compiling a huge framework and my wife walks in, I need to turn the volume down.

Right Now.

3 Comments:

At 1/15/2006 3:10 PM, stuffonfire said...

Heh. Remember the NRW? One processor for WindowServer, one for everything else. Apparently it doesn't work that way now; although task_set_processor_affinity() (or whatever) exists, it's not used.

A client-server UI model is always going to benefit greatly from a dual (or n-) processor system. Plus, these days, there are so many other daemons serving as the backend for the OS' API calls - configd, lockupd, WindowServer and pbs, coreaudiod, DirectoryServices...

 
At 2/15/2006 11:12 AM, Nevyn said...

Y'know, what you describe sounds a whole lot like a Mac with way too little RAM.

 
At 2/15/2006 5:40 PM, cjwl said...

Granted RAM does help, but both the dual 450mhz and the single 1.4ghz have the same amount of RAM (512MB) and the user experience is significantly better on the dual processor machine despite the lower speed.

My hunch is that IPC is the real culprit, OS X uses IPC like it is going out of style and context switching is expensive. It would be interesting to see some IPC benchmarks.

 

Post a Comment

<< Home