DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing drivers in C++

Performance considerations

When writing C++ device driver code it is important to know what language features might cause unacceptable runtime performance.

Exception handling and RTTI are generally have the most serious performance ramifications, but they are not used in device drivers.

Object-oriented programming and polymorphism have some performance overhead, generally due to virtual function call indirection and the loss of inlining opportunities. Whether this overhead is acceptable must be judged on a case-by-case basis.

The language features that make up C++'s support for abstract data types and "a better C" -- such as classes, private members, and namespaces -- generally impose no additional overhead relative to C and can be used as desired.

The language features that make up C++'s support for generic programming -- primarily templates -- do not generally impose an execution time performance penalty. Depending upon how templates are instantiated, however, there can be object code space overhead. This can usually be controlled by appropriate template usage and/or instantiation directives.


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005