Optimal swapping of stl containers

Never use a temporary variable to swap two stl containers instead always use std::swap function. This function has different overloaded versions specialized in swapping every standard container. So what’s the difference if we use a temporary variable swap and std::swap. The idea is that basically all stl containers use dynamic memory to store data, so […]
Continue reading…

 

Performance measurement functions in windows

Sometimes it does become mandatory to check performance or log performance of certain function calls, something like mini profiling. There are some functions in windows which helps us in doing this. I will rank them in their importance… QueryPerformanceCounter GetTickCount clock Of these three QueryPerformanceCounter is the best providing us with a high resolution counter. […]
Continue reading…