Why would GetMessageW take up massive CPU usage in my WPF application?

前端 未结 4 1704
Happy的楠姐
Happy的楠姐 2021-02-20 08:07

I\'ve got a serious head-scratcher on my hands here. I\'m investigating performance issues with a WPF component in our application.

Our .net application is very large,

4条回答
  •  感情败类
    2021-02-20 08:37

    I found this while searching for information on the same issue. I'll add what I know and see if it helps:

    I'm running on a WinXP box - the WPF framework is more integrated in Vista and Win7 than it is in XP. Some of this could be due to how WPF runs "on top" of the XP desktop, rather than within it.

    I'm running a pure native WPF application - with no WinForms or other code.

    I ran into this trying to determine why simply scrolling a window would consume 100% CPU and stutter while doing it.

    Running the AQtime performance profiler, I see that IntGetMessageW occupies the largest part of that 100% CPU usage. This is not due to IntGetMessageW waiting for a message, but something the function is actually doing.

    The one thing I haven't looked into yet is that maybe IntGetMessageW has never been a fast method, and maybe WPF simply overuses it. It is possible that data bindings in WPF use the native Win32 message pump to update Dependency Properties within WPF. If that is the case, it could be that my window simply has too many bindings.

提交回复
热议问题