Important: The information in this document is obsolete and should not be used for new development.
Mixed Mode Manager Performance Issues
The Mixed Mode Manager, while extremely useful for maintaining compatibility between CFM-based code and classic 68K code, takes a significant number of instruction cycles to perform a mode switch, so you should keep this in mind when determining when and how often to switch between architectures.In general this is not a problem if the time spent switching architectures is a negligible percentage of the time spent in the called routines. For example, if your classic 68K application calls a PowerPC graphics filter plug-in, most of the execution time is spent crunching numbers in the plug-in, so performance is not affected.
However, consider a short PowerPC patch for an emulated classic 68K software program. Theoretically increasing the amount of native PowerPC code should improve performance. However, if the mode-switching time is a significant portion of the patch's execution time and the patch is in a location where it is called frequently, considerable "dead time" accumulates as the Mixed Mode Manager switches back and forth; in such cases performance can actually decrease. In extreme cases, the time spent mode switching is so great that a classic 68K version of the patch results in better performance than a PowerPC patch. To avoid such problems, you should create fat patches that contain both CFM-based and classic 68K code. See "Mode Switching Implementations," beginning on page 6-10, and "Accelerated and Fat Resources," beginning on page 7-4, for more information on creating fat programs.
© Apple Computer, Inc.
11 MARCH 1997