Answer the question
In order to leave comments, you need to log in
How to find bottlenecks in an MFC project where performance can sag a lot?
Good time!
The problem is the following, there is a project on MFC, at startup, just drawing the window takes 25-30% of the processor time. I can't find exactly that little infinite loop where this can happen. When you try to run the profiler, after writing a file with profiling data, the studio crashes. As a result, I can't see which function sags...
I did TRACE(..) in the OnPaint() method, connected with debugging and saw a ton of messages from OnPaint. Apparently his calls all the time and eat. But how to understand what is causing ... after all, these are mostly callbacks.
Who struggled with the performance, please share :) maybe there are some primary signs like a lot of invalidate () calls in the code, while (a == true) or something else.
UPD#1
When trying to profile from Visual studio 2013, we get the following:
UPD #2
The SPY++ program showed that a ton of WM_KICKIDLE messages are indeed being sent, although it is not clear where they come from.
Strange, I didn’t change anything in the code, even after all the tests I rolled back the commit, but the performance problem disappeared. A little annoying such a number of WM_KICKIDLE messages.
Thanks everyone!
Answer the question
In order to leave comments, you need to log in
Well, look for the Invalidate project and see where they are called from. Again, it is not a fact that it is Invalidate that leads to this, look at what events fly where. Spy++ is here to help.
I would try to fix the studio, because inventing a crutch, while there is a standard tool - a profiler - is somehow strange.
Well, or open up the project and MFC sources, look for what is being done there, in OnPaint.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question