自动优化Windows Forms InitializeComponent的性能

发布于 2024-12-05 16:05:10 字数 716 浏览 6 评论 0原文

我有一个带有完整 GUI 的程序,由于 InitializeComponent(),加载大约需要 750 毫秒。经过一些研究,似乎有一些技术可以缩短 .NET 处理 InitializeComponent 部分所需的时间。其中包括:

1:使用 NGen 或类似的。

2:使用多线程,如速度优化 Windows 窗体应用程序中所示3

:各种技术,例如在添加控件属性之前设置控件属性,如 优化 InitializeComponent(需要 1 秒) !)

不幸的是,(1) 仅将我的案例改进了大约 20%,而 (2) 和 (3) 的实现非常耗时,并且牺牲了完整 GUI 设计器的便利性。

是否有任何自动化解决方案可以直接获取源代码,并生成更短、更高效的 InitializeComponent()

I have a program with a full GUI that takes around 750 ms to load thanks to InitializeComponent(). After some research, it seems there are a few techniques to improve the time it takes for .NET to trundle through the InitializeComponent section. These include:

1: Using NGen or similar.

2: Using multi-threading as shown in Speed-optimise Windows Forms application

3: Miscellaneous techniques such as setting control properties before adding them as shown in Optimising InitializeComponent (takes 1 second!).

Unfortunately (1) only improved my case by around 20%, and (2) and (3) are time consuming to implement, and sacrifice the convenience of the full GUI designer.

Are there any automated solutions out there that take the source code directly, and produce a shorter, more efficient InitializeComponent()?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱已欠费 2024-12-12 16:05:10

对于 Windows 窗体应用程序来说,750 毫秒的启动时间实际上已经相当不错了。除非您想花费无数的时间来获得另外 20% 的收益,否则请将精力集中在用户便利性上。

顺便说一句,我非常怀疑是否有一个自动化的解决方案,工具很难猜测您的设计不需要什么。

For a Windows Forms application, a 750 ms startup time is quite good actually. Unless you want to spend countless hours just to gain another 20%, concentrate your efforts to user convenience.

I highly doubt that there is an automated solution for this by the way, it would be very hard for a tool to guess what is not needed for your design.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文