GWT 在开发模式下运行缓慢
我在开发模式下使用最新的 GWT 2.0 版本的 Eclipse Galileo,但它运行速度非常慢(我需要等待大约一分钟才能打开一个页面,但编译后,当我使用 Tomcat 5.5 运行它时,我的应用程序运行得很好) 。
我的代码不太重,我猜有一个与操作系统相关或软件不一致的问题,因为我以前也遇到过这个问题,但是当我重新安装Windows Vista SP2(我格式化了我的Windows驱动器并重新安装它)时,我的问题得到了解决几天后,它又变得太慢了。
我没有在我的Windows机器上安装任何特殊软件,所以我真的不知道为什么会出现这个问题。有什么建议吗?
I'm using Eclipse Galileo with latest GWT 2.0 version in development mode, but it runs really slow (I need to wait about a minute to open one page, but after compilation, my application works very well when I run it using Tomcat 5.5).
My code is not too heavy and I guess there is an OS-related or software inconsistency problem, because I'd this problem before, but when I reinstalled Windows Vista SP2 (I formatted my Windows drive and reinstalled it), my problem was resolved for a few days and then again it became too slow.
I didn't install any special software on my Windows machine, so I really don't know why this problem occurs. Any suggestion ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果它变得异常慢,但之前速度更快,并且您正在调试,那可能是因为您在方法条目上设置了断点。即使没有到达断点,这也会使事情变得非常慢。尝试清除断点。
If it has become unusually slow, but was faster previously, and you are debugging, that might be because you have a breakpoint set on a method entry. This can make things extremely slow, even if the breakpoint is not hit. Try clearing your breakpoints.
如果您使用 smartgwt,请确保禁用 firebug 或类似功能。这确实会降低开发模式下浏览器的速度。
就 NetBeans 而言,确实有一个名为 GWT4NB 的 GWT 插件。但 IDE 不是你的问题:)
If you're using smartgwt make sure firebug or similar is disabled. That will really slow down your browser in dev mode.
And as far as NetBeans is concerned there really is a plugin for GWT called GWT4NB. But the IDE is not your problem :)
第一次加载页面时,它会加载所有必需的 javacode(和 JVM)。稍后,每次刷新页面只会加载更改后的java代码,然后执行整个代码(不过我可能是错的)。因此,如果您每次想要查看所做的更改时都关闭浏览器然后重新打开页面,那么速度会很慢。如果您每次刷新页面,它应该很快(如果您所做的更改不是很大)。
Eclipse + GWT 2.0 并不是它缓慢的原因...(顺便说一句 Shubhkarman,如果我是对的,netbeans 没有 GWT 插件...)
First time you load the page, it loads all the necessary javacode (and the JVM). Later, each refresh of the page will only loads the changed javacode then execute the whole (I might be wrong though). So if you're closing the browser then reopening your page each time you want to see the changes you made, yes it's going to be slow. If you refresh the page each time, it SHOULD be fast (if the changes you made weren't huge).
Eclipse + GWT 2.0 is not the reason why it's slow... (by the way Shubhkarman, if I'm correct there is no GWT plugin for netbeans...)
从图像等临时文件夹中删除 gwt 缓存。 rpc 文件..等。比看表演。这是托管模式下速度变慢的原因之一。
Delete gwt cache from temporary folders like images. rpc files..etc. than see the performance. it is one of the cause to slow in hosted mode.
我发现在调试模式下运行 GWT 托管模式与在非调试模式下运行 GWT 托管模式之间的性能差异很大。如果您正在使用调试运行,请尝试在不使用调试的情况下运行,看看是否有帮助。
初始页面加载可能很慢,但是一旦开始,只需单击浏览器上的刷新即可在几秒钟内重新加载更新的项目。
I've found that the performance difference between running the GWT hosted mode in debug vs. non-debug to be large. If you're running with debug, try running without to see if that helps.
The initial page load can be slow, but once you get going just clicking refresh on my browser reloads the updated project in just a few seconds.
我遇到了类似的问题,我发现它是由于断点数量而发生的。减少断点数量后,性能得到改善。
I had similar kind of issue and I found that it was happening because of number of break points. After reducing number of break points performance got improved.
即使我对 GWT 也有同样的问题。我现在开始用firefox进行测试。我第一次在 Firefox 上运行调试时,速度很慢。
我在 runconfig > 中将日志级别设置为“info” gwt tab
因此,我重新评估了我的工作区和 Firefox。然后 'debug >myGWTapplication '
当您在调试模式下打开应用程序时,请等待浏览器插件立即连接。
这次它不会在开发模式下写入所有日志行,并且速度更快。
我认为 Firefox 和日志记录带来了差异。现在我没有看到太多滞后。
另外,正如上面的评论中提到的,删除调试点,我已经删除了所有,并在必要时使用。
编辑:在 IE8 上尝试过 - 这是快速事件。
Even I had the same issue with GWT. I've started testing with firefox now. first time when I ran the debug on firefox, it was slow.
I set the log level to 'info' in the runconfig > gwt tab
So, I restrated my workspace and the firefox. Then 'debug >myGWTapplication '
When you open your application on debug mode, wait for the browser plugin to connect now.
This time it does not write all the log lines in the development mode, and it is faster.
I think the firefox and the logging has made the differance. Now I do not see much lag.
Also as mentioned in the above comments, remove the debug points, i've removed all, and use then when necessary.
Edit: tried it on the IE8 - it is fast event there.