This section provides some preliminary discussion of the overhead associated with mode switches and parameter passing. The Mixed Mode Manager requires the equivalent of approximately fifty 680x0 instructions to switch from one environment to another. As a result, you might want to minimize the number of times your code invokes a mode switch. Some mode switches are entirely avoidable. Once again, the Mixed Mode Manager will select the code that minimizes mode switching.
Some mode switches, however, are entirely unavoidable.
Any time your PowerPC application calls a system software routine that has not yet been ported to use the native PowerPC instruction set, the Mixed Mode Manager must switch to the 680x0 environ- ment to execute the routine and then switch back to the PowerPC environment to allow your application to continue. A good example of this behavior concerns calling Event Manager routines, which remain as 680x0 code in the first release of the system software for PowerPC processor-based Macintosh computers. Moreover, because your code is native PowerPC code, it executes more quickly between Event Manager calls than it did in the 680x0 environment. The result is that your application is switching modes more often than it absolutely has to. Although you cannot avoid the mode switches entirely when calling the Event Manager, you can lessen the overall impact of those switches on your application's performance by doing more work between successive Event Manager calls.