性能问题 - Winforms C# 中的 Visible 和 RightToLeft
我正在现有的 winforms 项目上做一些注重性能的工作。 此表单是动态生成的,而不是在设计时生成的,它加载几十个用户控件,并将它们绑定到包含一小组数据的 DataSet 对象。
使用一些分析工具(ANTS、Avicode),我可以看到大部分时间(大约 50%)是由我必须显示表单上的选项卡页的代码占用的。深入研究,我发现它大致分为两个操作:
1)一长串 VisibleChanged/SetVisibility/SetVisibleCore 操作,全部位于 winforms 命名空间中。我如何知道所花费的时间(在我的例子中为 4.5 秒)是否合理?我的表单中确实有很多用户控件。
2) 同样是一长串 RightToLeftChanged 操作,大约需要 4.5 秒。在这里,我也想知道这是否是 WinForms 的预期/正常性能。
任何有关在这里查找性能问题或我得到的性能是否正常的建议都会有很大帮助。提前致谢 :)
I'm doing some performance minded work on an existing winforms project.
This form is made dynamically rather than at design time, and loads a few dozen user controls, as well as binding them to a DataSet object with a small set of data.
Using some profiling tools (ANTS, Avicode), i can see most of time, around 50%, is taken by the code i have to show a tab page i have on the form. drilling down, i see it divides roughly in half to two operations:
1) a long line of VisibleChanged/SetVisibility/SetVisibleCore operations, all in the winforms namespaces. How can i know if the time it takes (4.5 seconds in my case) is sane? I do have a lot of user controls in my form.
2) A long line of RightToLeftChanged operations, again, around 4.5 seconds. Here too, I'm wondering if this is expected/sane performance of WinForms.
any advice regarding finding the performance issues here or whether the performance i'm getting is normal would go a long way to help. Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论