开发者

Knowing the event stack size

I'm facing a tricky problem and I hope you guys will be able to help!

An application I'm working on is getting slow a开发者_高级运维t some point of its lifetime and I suspect it's related to incoming events.

In order to clarify this behavior and know if it's the actual source of my nightmares, I would like to trace the event stack size.

So do you guys know a way to know how many events are queued, waiting to be processed by the event handler of my application?

Is it possible to change this value ? Does my question make any sense?

Thanks in advance!


I know this is not a direct answer to your question but i usually do my performance tuning with the help of profiling software. For .NET i can recommend jetbrains dotTrace but i'm sure you'll find one in this SO question.


This might depend on what kind of event you're handling. I guess that events in winform enviroments have a good part of overhead but that might not be the problem.

Another setup is to simply let all events 'post' a workitem into a list and let the 'worker' threads empty the work list. This lets you see the workitem list and gives you some control/directions to optimize the code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜