Advocacy

  Myths
  Press

Dojo (HowTo)

  General
  Hack
  Hardware
  Interface
  Software

Reference

  Standards
  People
  Forensics

Markets

  Web

Museum

  CodeNames
  Easter Eggs
  History
  Innovation
  Sightings

News

  Opinion

Other

  Martial Arts
  ITIL
  Thought


Macs have too much emulation
What is emulation anyways?

By:David K. Every
©Copyright 1999


Mac users get constantly bombarded with statements about emulation. Especially by those that haven't used Macs or don't understand the issues.

Emulation is a way to allow a new Processor or Operating System, understand the commands of an older ones. Since this has some overhead, there is usually performance drops - but not always.

When Apple moved from the Motorola 68000 family of processor to the PowerPC family of processors, they decided to emulate the older processors instructions. This allows all the old programs to work, even on the new processor. It also saved Apple from having to rewrite all their OS in one pass, and let them focus on critical parts first.

Mac Application spend most of their time (as much as 80 - 90%) calling the Mac Toolbox (the Operating System routines). So Apple profiled those routines to find out which were called the most often, and which were taking the most time. They found that about 20% of those routines were called about 80% of the time. So Apple quickly rewrote those routines for the PowerPC. So by the time Apple released the PowerMacs, already the routines that were run most of the time were PowerPC Native - and only routines that were executed a minority of the time were emulated. (Also all the old code - (non updated Applications) were running emulated.

 

  1. The first PowerPC's were about as fast as the 68000 (68K) machines for running 68000 code (circa 1994 machines).
  2. The fastest first generation PPC's were faster than the fastest 68K's ever made.
  3. PPC's today can emulate a 68000 probably 10 times faster than any 68000 machine ever made.

The myth started because the slowest PPC's were slower than the fastest 68K machines, but not by much. PowerPC performance was blotchy - some things were 10 times faster, and some things about 1/2 as fast - but overall, users got at least the same performance (1). The negative people focused on those few slower things, and distorted that into some myth -- the reality was far different.

(1) An example is floating point performance. Apple did not emulate the 680X0's FPU, because the FPU of the PPC's was literally 10-100 times faster than the 680X0's. So 68K apps running old FP stuff were slower on PPC's, but those were the type of Apps that were rewritten the quickest -- and got the largest performance gains.

This is where some rumors came from that PPC's had too much emulation and were too slow. Too slow was relative to the native Applications - which were much faster. Users that were complaining were often complaining as much about the Applications not being native as they were about the system - especially when they saw a native app running side by side (and it flew). The new machines were still faster than their old machines, but not as much as they could have been. But the 68K apps of the time were still running pretty good - and the Apps that needed power and speed were very quickly updated to be native.

About a year later (circa 1995), almost ALL the high-performance Applications had been rewritten to be PowerPC native. Also around this time the PowerPC's jumped from 60-80mhz into their second generation - the 100-132 Mhz. Applications were almost twice as fast as the first generation of PPC's - and Apple had improved the emulator by making it twice as fast (on new Machines) as the previous emulator (using DR-Emulator). So the remaining native code (which is a lot of code, but is run a minority of the time) doubled in speed because of the emulator, and doubled again because of the newer Processors. Apple rewrote the disk I/O stuff and the Networking to be native. There was no 68K's machines that could come close to touching these machines even in all emulated Apps, and for native Applications these machines flew. Apple also updated some of the older machines emulators with a System update (or some people used Speed-Doubler, which is faster than Apples emulator). Apple also updated a bit more of its System to have less emulated code. So only the early adopters (first generation) had complains, and even then it was only early on -- things have gotten better as time has gone on.

About a year later (circa 1996) the machines took another generation. Apple released another System update - with even more native code. At this point I would say that about 30-40% of the System Code is native, but if you profile how much of the time an Application or the System is actually running emulated code it is probably less than 10%, and the things the system is doing in that 10% of the time, are not the most performance critical tasks anyways. Processors again jumped, and 200mhz processors became vogue. Machines now were likely 4 times faster than any PPC's, and blowing the doors off of pentiums for most tasks. There is still a fair amount of emulated code in the system - but not if you are looking at how frequently it is run (instead of how many lines of code there are).

So not only was processor performance progressing all during the evolution of the PowerMacs, but so was the OS. Apple has been tweaking and reducing the amount of emulation. There are a few areas left - but overall the great majority of the time is spent in native code. Apple has also made the emulator faster, and most Apps are native as well - and performance critical parts of the computer are definitely native. PPC performance still blows the Pentiums away in Application tests (which average both native and emulated code). So next time a PC person is complaining that the Mac has too much emulation - just remind them that it is still faster than their PC.

Exceptions - there certainly are exceptions to the norm. In general the PC's tend to do a bit better in areas of the OS around virtual memory and some networking. The new networking system (OpenTransport) has altered the networking stuff, and Macs are doing much better. Apple has also recently doubled the performance of their VM, but I still don't think it matches the PC. This has more to do with architecture and design than native or emulated code. The majority of the PowerMacs still blow away the majority of the PC.

PC's have emulation of sorts - WindowsNT has something called WoW (Windows-on-Windows). This is an emulator to allow it to run 16 bit (Win3.1) applications. This emulator is run if ever a user runs an app not specifically written for WinNT (any DOS or Win3.1 applications). This type of emulation is slightly different because it only remaps calls and does not have to emulate a different processor, but because of alignment issues on newer processors (like the PPro's) this can cause a very substantial performance decrease.

Windows 95 is not much better. It has 16 bit (older legacy code) and new code all intermixed. If a user runs a single 16 bit App or driver, they lose features that they are told they have (like PMT). This is an emulation of sorts - or at least is that the new system is not all that it promised to be. Win95 was sold as a 32 bit OS, but it is not. This is sort of a built-in emulation for the older DOS and Win3.1 stuff. Either that or it is fraudulent to imply that it is a 32 bit OS, so they would do better to call it "emulation".

Mac users need to start reminding Windows users that they have "too much emulation".

P7 (Merced) - Because of the legacy issues with keeping older applications running - but the need for updating the instruction set - Intel is likely going to build emulation in to their next big generation change of Chips. This chip is called either the P7 (or code named Merced) and will be somewhat of a RISC processor (like the PowerPC's) but have to dedicate a lot of space to emulating the older instruction set. That means to get the full performance, users will have to rewrite all their code to be "native", or they will run at less performance in "emulation". The only difference is that it will take the PC a lot longer than the PowerMacs to evolve their code from emulation to native.


Created: 02/02/97
Updated: 11/09/02


Top of page

Top of Section

Home