0

I would like to profile a GUI application that uses a message queue. In the profiler results window I see that 80% of the samples are within message loop handling code. Is it possible to filter out the results somehow that I only see the code I can influence?

I am using Visual Studio 2013 C++ profiler.

André Dion
  • 21,269
  • 7
  • 56
  • 60
tommyk
  • 3,187
  • 7
  • 39
  • 61
  • 1
    if most of the time is being spent in the message loop it would seem that there is not much performance improvement to be had. are you seeing a problem with GUI responsiveness? there are other data collection methods that you can use and perhaps sampling is not a good approach for your application. see [How to: Choose Collection Methods](https://msdn.microsoft.com/en-US/library/ms182374.aspx) which is for VS 2015 but probably would be helpful with VS 2013. – Richard Chambers Sep 11 '15 at 13:09
  • so, you mean to say, some part of application is handled by you and the message queue handling thread/code is not under your control?? – basav Sep 11 '15 at 13:09
  • @basav In the application code I just have event handlers e.g. MyFancyButton::OnButtonClicked and the GUI framwork (wxWidgets in my case) implements message queue. – tommyk Sep 11 '15 at 14:19

1 Answers1

1

What I might do is take each event handler and put a temporary outer loop in it, to make it take a lot longer than it normally would. It needs to run long enough that manual sampling can be used.

This allows finding any possible speedups in the event handlers. After those are fixed, the outer loops are removed, and the code flies!

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135