Jim Helman (jimh++at++surreal)
Mon, 20 Feb 95 13:48:08 -0800
Performance rules.....
C++ is like a psychoactive power tool. When abused or
handled carelessly C++ is quite capable of cutting the
legs off your CPU and at the same time leaving you quite
pleased with this outcome. The excuse that one can afford
to ignore the performance implications of a design because
CPUs are getting faster is a load of hooey, especially if
you look where graphics/CPU ratios are going. But handled
properly and applied to appropriate problems, C++ can
improve both code structure and performance.
In short, the new C++ API and the prerequisite port of
libpr to C++ will help both us and our developers write
better code and I don't expect much performance difference
as a result.
Some things will be slightly faster in the C++ port:
1) Virtual function tables are more efficient than our
old switch-statement polymorphism for libpr pfObjects.
2) C++ inline functions make many of the simple get and
set operations in libpr faster both for C++ applications
and for libpf.
3) Applications written in C++ will no longer need to go
through the libpf CAPI wrappers or the pervasive tests
in current libpf and libpr CAPI to see if the first
argument (this) is NULL.
4) Some libpr routines will be tuned to be faster because
of things we've found in going through every line code.
Some things will be slightly slower in the C++ port:
1) Applications written in C will need to go through new
libpr CAPI wrappers, but for most performance-critical
functions, e.g. math, there won't be any difference
since these are inlined into the CAPI wrappers.
rgds,
-jim helman
jimh++at++surreal.asd.sgi.com
415/390-1151
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:59 PDT