If you can get by using simple indicators, in the past I implemented a simple profiler. Track your memory and time. Track the start and stop of each function, print a line at the start and stop. Track your memory before and after if it matters. All this is due to a run-time variable that you can change from the outside. In a web application, this may be an optional post / get parameter. In a thick client program, this may be an additional key.
Then at runtime you can start collecting data. In the past, I added several layers to provide selective and then more detailed data collection.
Good luck.
source share