Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Shiny is a free C++ profiler. It works under (amongst other) G++. I have not got it to work under C++ Builder.
You cannot use Shiny in C++ Builder.
But you can use the preprocessor to remove the Shiny macro's:
#ifndef _WIN32 |
Suppose we want to compare the runtime speed of the STL std::sort and bubble sort.
#include <algorithm> |
Compile the program with for example:
g++ -o Main UnitMain.cpp ../../Shiny/ShinyManager.cpp ../../Shiny/ShinyNode.cpp ../../Shiny/ShinyNodePool.cpp ../../Shiny/ShinyTools.cpp ../../Shiny/ShinyOutput.cpp |
Then run the program and the following text file (called profiler.rtf) is created:
flat profile hits self time total time |
The program has spent 100% of 103% in the function BubbleSort and only less then 0.5% in QuickSort. You have now measured that in this case QuickSort is faster. This was just as expected for large std::vector sizes.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.