I compared these operations with the exact same ones if the proxies were replaced by raw pointers. Each of the four tests is done by a different file, located in the NoPtrLibRootDir/tests/performance (NoPtrLibRootDir is wherever you put the NoPtr lib). So far the timing results are great, except for container re-ordering. The table lists the time (in seconds) for executing every test, for raw pointers, for the NoPtr equivalents, and for the boost::shared_ptr equivalent, and the hit is for NoPtr vs raw:
====================================================================
| | Construct Return_tmp Access Construct_STL Re-order |
--------------------------------------------------------------------
| raw | 21 21 27 20 13 |
| noptr | 22 25 28 31 113 |
| boost | 48 56 28 39 113 |
--------------------------------------------------------------------
| % hit | 5 18 3 60 770 |
====================================================================
Discussion:
So other than for re-ordering the elements of an STL container via std:: algorithms, the performance hit for having the functionality of NoPtr should be minimal for the typical program. Hopefully, the above numbers will help you estimate what would be the hit for your particular application and if the extra functionality of NoPtr is worth it.
figure out if re-ordering performance can be improved for DynObj
1.3.2