Delphi XE2:F12 在单位和表单之间切换速度慢得令人难以忍受
这个问题困扰了我很长一段时间,几个月前我直接从 D2007 切换到 XE2,我无法保证这个问题何时开始,但在 D2007 上我没有遇到这个问题。
单元越大,代码更改时使用 F12 在单元和表单之间切换的速度就越慢。即使您取消停靠表单设计器(返回到 D7 格式),在代码更改后单击返回表单也会导致 BDS.exe 长时间占用 CPU 资源。就我而言,在最大的表单(30,000 行)上,这可能会超过一分钟。我不确定重新激活表单时会进行哪些检查,但如果 IDE 已被“告知”所有内容都是最新的,则切换是即时的。因此,我的解决方法是在重新激活表单之前使用 Ctrl+F9 编译表单。编译时间仅需几秒钟。然后我可以立即切换到该表单,不会出现任何问题。相比之下,如果我在切换之前不进行编译,我会忍受一分钟或更长时间的等待……
那么,除了减小单元大小之外,还有什么可能性?!
This one has been annoying me for a long time and having switched directly from D2007 to XE2 a few months back I can't vouch for when this may have started, but on D2007 I didn't have the issue.
The larger a unit grows, the slower it becomes to use F12 to switch between unit and form when code changes have been made. Even if you undock the form designer (back to D7 format), just clicking back into the form when code has been changed causes the BDS.exe to max out on CPU for a long time. In my case, on my largest form (30,000 lines) this can be over a minute. I'm not sure what checking is going on when reactivating the form, but if the IDE has been "told" that all is uptodate, then the switch is instantaneuos. My workaround is therefore to Ctrl+F9 to compile the form before reactivating the form. The time taken to compile is only a few seconds. I can then switch instantly to the form without issue. Compare that to the minute or more wait I endure if I don't compile before switching...
So, what are the possibilities, apart from reducing the unit size ?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LiveBindings 设计时包中存在一个错误,会降低 IDE 的速度。代码完成(Ctrl+Space)以及表单和代码编辑器之间的切换非常慢。
如果您不使用 LiveBindings 或想要测试它是否确实是 LiveBindings 设计时代码,您可以禁用组件/安装包...下的 LiveBinding 包。它们是
Embarcadero LiveBindings 组件
、Embarcadero LiveBindings 组件 FireMonkey
和Embarcadero LiveBindings 组件 VCL
。如果禁用第一个,其他两个将自动卸载。如果您在项目中使用 LiveBindings,则必须等待更新,或者您可以安装 XE2 IDE 修复包修复了这个错误。
There is a bug in the LiveBindings design-time package that slows down the IDE. CodeCompletion (Ctrl+Space) and switching between form and code editor is very slow.
If you don't use LiveBindings or want to test if it is really the LiveBindings design-time code, you can disable the LiveBinding packages under Component/Installed Packages.... They are
Embarcadero LiveBindings Components
,Embarcadero LiveBindings Components FireMonkey
andEmbarcadero LiveBindings Components VCL
. If you disable the first, the other 2 will automatically be unloaded.In case you use LiveBindings in your project you have to either wait for an Update or you can install the IDE Fix Pack for XE2 that also fixes this bug.
我在安装修补程序“RAD Studio XE Hotfix for RAID 280864 (QC 88928)”后修复了此问题。
页面:https://edn.embarcadero.com/article/41312
I fixed this after I installed the hotfix "RAD Studio XE Hotfix for RAID 280864 (QC 88928)".
page: https://edn.embarcadero.com/article/41312