Apple Darwin Bedienungsanleitung Seite 9

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 68
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 8
I/O Kit Drivers and Other Kernel Extensions
Because a 64-bit kernel cannot load 32-bit kernel extensions, it is imperative that all kernel extensions be
compiled 64-bit. Beginning in OS X v10.6, some hardware configurations use a 64-bit kernel by default, and
beginning in OS X v10.8, all supported hardware configurations use a 64-bit kernel exclusively. This means
that if your kernel extension is not 64-bit, it will not function in OS X v10.8 and later.
Performance-Critical Applications
Even in older versions of OS X, if your application is performance critical, you might want to recompile your
application as a 64-bit executable, particularly on Intel-based Macintosh computers.
Heres why. The 64-bit Intel architecture contains additional CPU registers that are not available when compiling
a 32-bit Intel executable. For example, the 64-bit architecture has 16 general-purpose integer registers instead
of 8. Because of the extra register space, the first few arguments are passed in registers instead of on the stack.
Thus, by compiling some applications as 64-bit, you may improve performance because the code generates
fewer memory accesses on function calls. As a general rule, 64-bit Intel executables run somewhat more quickly
unless the increased code and data size interact badly (performance-wise) with the CPU cache.
As with any complicated software system, it is difficult to predict the relative performance of recompiling a
piece of software as a 64-bit executable. The only way to know for certain (on either architecture) is to compile
for 64-bit and benchmark both versions of the application.
Here are some of the potential performance pitfalls:
Larger code and data size can result in increased cache and translation lookaside buffer (TLB) misses.
Larger code and data (both pointers and long integers) can require more memory to avoid paging.
Multiply and divide operations are slower when performed on 64-bit quantities than 32-bit quantities.
Other operations take roughly the same amount of time as their 32-bit counterparts. Thus, if your code
frequently multiplies values of type long, you will see a performance impact. (The reverse is true for type
long long because 64-bit applications do not have to break 64-bit operations up into multiple 32-bit
operations.)
When you use a 32-bit signed integer as an array index, if that number is not stored in a register, the CPU
will spend extra time on each access to sign-extend the value.
For the most part, these potential performance impacts should be small, but if your application is performance
critical, you should be aware of them.
Should You Recompile Your Software as a 64-Bit Executable?
I/O Kit Drivers and Other Kernel Extensions
2012-12-13 | Copyright © 2004, 2012 Apple Inc. All Rights Reserved.
9
Seitenansicht 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 67 68

Kommentare zu diesen Handbüchern

Keine Kommentare