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

前端 未结 4 1719
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

    Yes, this is normal. Any GUI app is always executing GetMessageW(), waiting for Windows to send it a message. It isn't actually burning CPU cycles doing this, just blocked on an internal synchronization object until some kind of UI event is signaled.

    This of course makes profiling UI apps difficult, you really need unit tests that test the subcomponents of your app.

提交回复
热议问题