#include #include #include #include #include #include #define TEST_NODES 100000000 //typedef std::vector EDA_ITEMV; //typedef std::deque EDA_ITEMV; typedef boost::ptr_vector EDA_ITEMV; void heap_warm_up(); int main( int argc, char** argv ) { EDA_ITEMV v; DLIST dlist; unsigned vAllocStart; unsigned vAllocStop; unsigned vIterateStart; unsigned vIterateStop; unsigned dAllocStart; unsigned dAllocStop; unsigned dIterateStart; unsigned dIterateStop; heap_warm_up(); vAllocStart = GetRunningMicroSecs(); for( int i=0; iType() == -22 ) { printf( "never this\n" ); break; } } vIterateStop = GetRunningMicroSecs(); #if 0 for( int i=0; iNext() ) { if( it->Type() == -22 ) { printf( "never this\n" ); break; } } dIterateStop = GetRunningMicroSecs(); printf( "vector alloc: %u usecs iterate: %u usecs\n", vAllocStop - vAllocStart, vIterateStop - vIterateStart ); printf( "dlist alloc: %u usecs iterate: %u usecs\n", dAllocStop - dAllocStart, dIterateStop - dIterateStart ); } void heap_warm_up() { // dry run allocate enough object for process to obtain all memory needed EDA_ITEMV vec; for( int i=0; i