Eclipse webtools 项目 (WTP) 及其性能/质量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5433991/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:02:48  来源:igfitidea点击:

Eclipse webtools project (WTP) and its performance / quality

javaeclipsejspideeclipse-wtp

提问by MRalwasser

Our company is using eclipse since several years now (we are using WTP since release 0.7)

我们公司已经使用 eclipse 好几年了(我们从 0.7 版开始使用 WTP)

I am currently evaluating eclipse 3.6.2 with WTP 3.2.3which should replace eclipse 3.4.2 with WTP 3.0.4 as being our main IDE.

我目前正在使用 WTP 3.2.3评估eclipse 3.6.2,它应该用 WTP 3.0.4 代替 eclipse 3.4.2 作为我们的主要 IDE。

And I have to say that once again I am quite disappointed in concerns of performance:
WTP 3.2.3 seems to be much slower than 3.0.4.
In fact I am really wondering why WTP gets slower with each release.

我不得不再说一次,我对性能问题感到非常失望:
WTP 3.2.3 似乎比 3.0.4 慢得多。
事实上,我真的很想知道为什么每次发布 WTP 都会变慢。

One of our applications (dynamic web project) contain about 4000 java classes and 700 jsps/jsp fragments. We only need basic WTP functionality for developing jsps, xmls and xsd. We don't need high sophistic features like Dali(should JPA tools really covered by a webtools project?), Libraor a visual xml editorin the first place.

我们的一个应用程序(动态 Web 项目)包含大约4000 个 java 类和 700 个 jsps/jsp 片段。我们只需要基本的 WTP 功能来开发 jsps、xmls 和 xsd。我们不需要像Dali(JPA 工具真的应该被webtools 项目覆盖吗?)、Libra可视化 xml 编辑器这样的高级功能。

Another interesting point is that WTP seems to slow down the whole IDE. SWT is non-reponsive for some fraction of seconds, cpu usage is very high (especially after a built took place - if you look at the system jobs, several jsp/javascript indexers are doing work for some minutes, even if all WTP build validators have been disabled), opening new files are slower, navigating through the project etc.

另一个有趣的点是 WTP 似乎减慢了整个 IDE。SWT 在几秒钟内没有响应,cpu 使用率非常高(尤其是在构建完成之后 - 如果您查看系统作业,几个 jsp/javascript 索引器正在工作几分钟,即使所有 WTP 构建验证器已被禁用),打开新文件较慢,浏览项目等。

This can be especially seen on older machines which do contains only a single core cpu.

这在仅包含单核 cpu 的旧机器上尤其明显。

The worst thing is that I've got the feeling that the WTP dev team does not care much about performance(e.g. have a look at the http://wiki.eclipse.org/WTP_Performance_Testspage - last update took place in 2008).

最糟糕的是,我感觉 WTP 开发团队不太关心性能(例如,查看http://wiki.eclipse.org/WTP_Performance_Tests页面 - 上次更新发生在 2008 年)。

Bug reports and Newsgroup posts regarding to performance of basic features (e.g. jsp editing/validating) are often ignored or closed after some time, some examples: here, here, and here.

bug报告和关于向的基本特征表现新闻组帖子(如JSP编辑/确认)一段时间后,往往被忽视或关闭,一些例子:在这里这里这里

Quo vadis, WTP?

现状,WTP?



Please don't get me wrong:

请不要误会我的意思:

I don't want to blame WTP.
In fact I believe that WTP is a good open-source project developed by a talented team.
But obviously the project has a problem with its quality assurance, especially in terms of performance which affects usability and user acceptance.

我不想责怪 WTP。
事实上,我认为 WTP 是一个由才华横溢的团队开发的优秀开源项目。
但显然该项目在质量保证方面存在问题,尤其是在影响可用性和用户接受度的性能方面。

I just want to point out that the team should focus on the things which are essential to most of the usersin the first place and afterwards work on implementing super-duper-features.

我只想指出,团队应该首先关注对大多数用户来说必不可少的事情,然后再努力实现超级功能。

My Questions

我的问题

  • What are your experiences with WTP, especially the most recent releases?
  • Can you confirm or disprove my observations?
  • Are there better alternatives?
  • Did you switch from or to WTP and why?
  • Do you have some best practices to speed it up, especially for upper-mid-sized like ours?
  • 您对 WTP 的体验如何,尤其是最近的版本?
  • 你能证实或反驳我的观察吗?
  • 有更好的选择吗?
  • 您是从 WTP 切换还是切换到 WTP,为什么?
  • 您是否有一些最佳实践可以加快速度,尤其是对于像我们这样的中上型企业?


UPDATE

更新

I'd like to make an update on this question to reflect the current answers and to sum up the current results:

我想对这个问题进行更新以反映当前的答案并总结当前的结果:

  • Many users complain about more or less on the same issues so I see those issues as confirmed.
    BTW, this question is also mentioned on a news post on theserverside.comwith additional comments.

  • The responsible WTP project lead, nitind, made a notable post on the current situation of WTP, which I like to cite:
    "The simple fact is that we don't spend much time on performance tests because we lack resources for doing that."
    "Of course we'd like to be proactive about it rather than reactive, but we tend to allocate our time to functional problems first."

  • 许多用户或多或少地抱怨相同的问题,所以我认为这些问题已得到确认。
    顺便说一句,theserverside.com的新闻帖子中也提到这个问题并附有其他评论。

  • 负责的 WTP 项目负责人 nitind 发表了一篇关于 WTP 现状的重要帖子,我喜欢引用它:
    “简单的事实是,我们没有花太多时间在性能测试上,因为我们缺乏这样做的资源。”
    “当然,我们更愿意积极主动而不是被动应对,但我们倾向于首先将时间分配给功能性问题。”

So this question turns a little bit into some kind of an open letter from the community to the WTP team:

所以这个问题有点变成了社区给 WTP 团队的公开信:

Dear WTP team,

it's obvious that WTP is suffering from major quality/performance issues 
which you try to play down or to ignore.
Please invest some time to improve the current situation 
at the cost of new features and do everything what's required 
to solve the current problems.
E.g. revive the performance team, do some regression tests between 
previous releases or ask the community for (precise defined) help.

I am sure that they are enough people willing and able to help here.

If you like, do some kind of poll to get a feeling what should be 
the most important scopes of future's WTP releases.

Please, please, listen to your community.

采纳答案by nitind

To respond, I'm the lead for the projects that supply the JSP, XML, and JavaScript source editing functionality in WTP. The simple fact is that we don't spend much time on performance tests because we lack resources for doing that. Of course we'd like to be proactive about it rather than reactive, but we tend to allocate our time to functional problems first. We do have an adopter product running performance regression tests regularly, but I expect that tests are run on multi-core machines by now--and we haven't had any new red flags reported to us for some time.

作为回应,我是在 WTP 中提供 JSP、XML 和 JavaScript 源代码编辑功能的项目的负责人。一个简单的事实是,我们没有在性能测试上花费太多时间,因为我们缺乏这样做的资源。当然,我们更愿意积极主动而不是被动应对,但我们倾向于首先将时间分配到功能性问题上。我们确实有一个采用者产品定期运行性能回归测试,但我希望现在测试是在多核机器上运行的——而且我们已经有一段时间没有收到任何新的危险信号报告给我们了。

Of the 3 bugs you linked to, 2 predate the 3.0.4 version you laud and the third is either a formatting performance issue (since addressed) or one with as-you-type validation specific to XML files (the fixing of which would have triggered a memory leak in Xerces, iirc, hence us not putting it in at that time). If you have concrete projects that you can attach to a bug and say "doing X is slower in 3.2 by Y amount", we'll do what we can to figure out where there's a regression.

在您链接的 3 个错误中,2 个早于您称赞的 3.0.4 版本,第三个是格式性能问题(自解决以来)或具有特定于 XML 文件的按类型验证的问题(修复这些问题将有在 Xerces、iirc 中触发了内存泄漏,因此我们当时没有将其放入)。如果您有具体的项目可以附加到错误并说“在 3.2 中执行 X 比 Y 量慢”,我们将尽我们所能找出回归的位置。

As for the indexers, they should at least eventuallycomplete. The on-disk information that is stored has changed between WTP versions, and those files need to be reprocessed so they're again included in search and (where implemented) refactoring operations. Once the initial indexing is complete, it should act incrementally and be virtually unnoticeable. One architectural change you may be running into is that for JSPs, the entire workspace needs to be indexed in a singleworkbench session for that index to be considered "up to date". Shutting down Eclipse out of frustration will only prolong the impact of that reprocessing.

至于索引器,它们至少应该最终完成。存储的磁盘信息在 WTP 版本之间发生了变化,这些文件需要重新处理,以便它们再次包含在搜索和(在实现的地方)重构操作中。一旦初始索引完成,它应该逐渐地起作用并且几乎不引人注意。您可能遇到的一种架构变化是,对于 JSP,整个工作区需要在单个工作台会话中建立索引,以便将该索引视为“最新”。出于沮丧而关闭 Eclipse 只会延长重新处理的影响。

It sounds like your company's standard install includes the entirety of WTP rather than rolling your own custom distribution. I urge you to check the Startup and Shutdownpreference page and turn off early startup of any functionality you're not interested in using. Nothing you've mentioned interest in makes use of that facility, but there are other areas of WTP and the Platform that do. Anything you're not interested in validating is fair game on the Validationpreference page, as well as the setting to validate JSP fragments by default on the Web/ JSP Files/ Validationpreference page.

听起来您公司的标准安装包括整个 WTP,而不是滚动您自己的自定义分发。我强烈建议您查看“启动和关闭”首选项页面,并关闭您不感兴趣的任何功能的提前启动。您提到的任何内容都没有兴趣使用该工具,但 WTP 和平台的其他领域也可以使用。您对验证不感兴趣的任何内容都是Validation首选项页面上的公平游戏,以及默认情况下在Web/ JSP Files/ Validation首选项页面上验证 JSP 片段的设置。

回答by Udo

We have the same problem with WTP 3.2.3 here, too. We use it in our product for several years, too but the acceptance of our developers and customers in this tool is decreasing every year because in every newer release it is slower and slower.

WTP 3.2.3 也有同样的问题。我们在我们的产品中使用它也有几年了,但是我们的开发人员和客户对这个工具的接受度每年都在下降,因为在每个新版本中它都变得越来越慢。

I would like to use it if I could disable all "advanced" features but as you mentioned you cannot disable the indexers at all. Also you cannot stop the validator of JSP files if it is already running (you can test this if you have that many files as you have and we also have around 1000 JSP files and many tag files in our project).

如果我可以禁用所有“高级”功能,我想使用它,但正如您提到的,您根本无法禁用索引器。如果 JSP 文件的验证器已经在运行,你也不能停止它(如果你有这么多文件,你可以测试它,我们的项目中还有大约 1000 个 JSP 文件和许多标记文件)。

I also can prove that increasing the memory does not help. It only prevents crashes of the whole eclipse but it does not reduce the UI blocking internal operations of WTP.

我也可以证明增加内存没有帮助。它只会防止整个 Eclipse 崩溃,但不会减少 UI 阻塞 WTP 的内部操作。

In the newest version 3.2.3I got many hangs when I start Tomcatfrom within the servers view. The UIjust hangsabout 1 minute. It's not only me who has the hangs, it's all my colleagues who work on Windows have the same problem. On Linux I do not know about this problem.

在最新的3.2.3版本中,当我从服务器视图中启动 Tomcat时,我遇到了很多问题。该UI刚刚挂起1分钟。不仅我有问题,我所有在 Windows 上工作的同事也有同样的问题。在 Linux 上我不知道这个问题。

Also there are problems in WTP when you have no access to the internet. It seems there are request to some registries to download schemas or such things and if you do not have a connection then it just hangs and waits for the time out.

当您无法访问互联网时,WTP 也会出现问题。似乎有一些注册管理机构要求下载模式或类似的东西,如果你没有连接,那么它就会挂起并等待超时。

回答by Jani Laakso

I have seen similar effects, here's one solution that might be suitable in some project environments...

我见过类似的效果,这里有一个可能适用于某些项目环境的解决方案......

To guarantee fast and responsible Eclipse Web project environment, consider this:

为了保证快速和负责任的 Eclipse Web 项目环境,请考虑:

  1. Use Eclipse IDE for Java Developers
    • 98MB version is leaner than 200MB EE version
    • from General / Startup and Shutdown, disable all but "Eclipse UI"
    • from Validation, disable validators which you do not need
    • these probablyprevent some performance issues (YMMW)
  2. Use Jetty
    • you do not need WTP or anyother plugins, it's pure Java
    • like Tomcat but very quick & simple to install into any IDE / environment
    • embed directly into your project files, configure once for every developer
    • works in any IDE (Eclipse, IDEA, JDeveloper..)
    • start Servlet Container with "Debug As" / "Run As"
    • shutdown Servlet Container by clicking red box on Eclipse console
    • IDE Console, debugging & hot code replacement & JRebel works fine
  1. 为 Java 开发人员使用 Eclipse IDE
    • 98MB 版本比 200MB EE 版本更精简
    • 从 General / Startup and Shutdown 中,禁用除“Eclipse UI”之外的所有内容
    • 从验证,禁用您不需要的验证器
    • 这些可能会防止一些性能问题(YMMW)
  2. 使用码头
    • 你不需要 WTP 或任何其他插件,它是纯 Java 的
    • 像 Tomcat,但非常快速且简单地安装到任何 IDE/环境中
    • 直接嵌入到您的项目文件中,为每个开发人员配置一次
    • 适用于任何 IDE(Eclipse、IDEA、JDeveloper..)
    • 使用“调试方式”/“运行方式”启动 Servlet 容器
    • 通过单击 Eclipse 控制台上的红色框关闭 Servlet 容器
    • IDE 控制台、调试和热代码替换和 JRebel 工作正常

Result: fast & responsive Eclipse when compared to many other Eclipse installations that use Eclipse EE version with WTP stuff.

结果:与使用 Eclipse EE 版本和 WTP 内容的许多其他 Eclipse 安装相比,Eclipse 快速且响应迅速。

Why? It might be that some Eclipse feature or plugin contains bugs or simply uses resources in a bad way and this makes Eclipse UI sluggish.

为什么?可能是某些 Eclipse 功能或插件包含错误或只是以错误的方式使用资源,这会使 Eclipse UI 变得迟钝。

Non-Java EE Eclipse is good enough even for many Java EE project environments, it all depends on your architecture and what tools you are using..

非 Java EE Eclipse 即使对于许多 Java EE 项目环境也足够好,这完全取决于您的架构和您使用的工具。

Here's a quick tutorial to get started in case you wish to try Jetty Servlet Container out with Eclipse. See https://vaadin.com/web/jani/home/-/blogs/vaadin-for-everyone-how-to-get-started. Download VaadinProjectForAnyIDE.zip, it's an Eclipse project. Just ignore that Vaadin stuff and replace HelloWorldApplication.java with your own servlet and edit web.xml accordingly.

如果您希望在 Eclipse 中试用 Jetty Servlet Container,这里有一个快速入门教程。请参阅https://vaadin.com/web/jani/home/-/blogs/vaadin-for-everyone-how-to-get-started。下载 VaadinProjectForAnyIDE.zip,它是一个 Eclipse 项目。只需忽略 Vaadin 的内容并用您自己的 servlet 替换 HelloWorldApplication.java 并相应地编辑 web.xml。

One more thing. With Eclipse EE version, you might also wish to try J2EE preview server which actually is Jetty embedded into Eclipse bundle. However, this also uses WTP mechanism.

还有一件事。对于 Eclipse EE 版本,您可能还希望尝试 J2EE 预览服务器,它实际上是 Jetty 嵌入到 Eclipse 包中的。但是,这也使用了 WTP 机制。

回答by Luis Fernando

I don't know who's to blame: WTP or JBoss Tools. The fact is that, as I work with GWT (minimal JSP), I went the opposite way: No WTP at all!!! I'm now using plain Eclipse for Java, and use a run configuration to deploy (programatically invoking ANT) and start the server, and I never looked back!!! Eclipse used to take ~1.5GB and crashed several times. Now, it sits on ~800MB, and the whole environment became more stable.

我不知道该怪谁:WTP 还是 JBoss 工具。事实是,当我使用 GWT(最小 JSP)时,我走了相反的路:根本没有 WTP!!!我现在使用 Java 的普通 Eclipse,并使用运行配置来部署(以编程方式调用 ANT)并启动服务器,我再也没有回头!!!Eclipse 过去需要大约 1.5GB 并且崩溃了好几次。现在,它位于~800MB,整个环境变得更加稳定。

回答by Arjan Tijms

I also think the stability and performance of Eclipse/WTP is somewhat alarming. I'm using Eclipse since mid 2003 and have been trying WTP since its very first releases.

我也认为 Eclipse/WTP 的稳定性和性能有点令人担忧。我从 2003 年年中开始使用 Eclipse,并且从它的第一个版本开始就一直在尝试 WTP。

At first the quality was absolute abysmal, but for a 0.x version I couldn't complain of course. While waiting for WTP to mature, I used MyEclipse, which was sort of okay but had its flaws too (and being partially based on WTP, inherited some of WTP).

起初质量绝对糟糕透顶,但对于 0.x 版本我当然不能抱怨。在等待 WTP 成熟的时候,我使用了 MyEclipse,它有点好,但也有它的缺陷(部分基于 WTP,继承了一些 WTP)。

When MyEclipse became heavier and heavier, slower and slower and we ran into several stability issues, we switched to 'pure WTP'. All we were using was really the basic JSP/JSF editor and deployer.

当 MyEclipse 变得越来越重、越来越慢并且我们遇到几个稳定性问题时,我们切换到“纯 WTP”。我们使用的只是基本的 JSP/JSF 编辑器和部署器。

Since WTP doesn't do incremental deployment (at least not for the JBoss server runtime) we added the separate server runtime from JBoss tools. When we adopted Facelets, we also switched to the editor from JBoss tools.

由于 WTP 不进行增量部署(至少不是对于 JBoss 服务器运行时),我们从 JBoss 工具中添加了单独的服务器运行时。当我们采用 Facelets 时,我们也从 JBoss 工具切换到编辑器。

We do however run into a lot of problems we also had with MyEclipse. There are unexplainable slowdowns, but much worse are various stability problems. There are lots of awkward exceptions and crashes. A typical .log file on many different workstations I examined is chockfull of exceptions. A small selection of the last 10 exceptions in my log:

然而,我们确实遇到了很多我们在 MyEclipse 中也遇到的问题。有无法解释的减速,但更糟糕的是各种稳定性问题。有很多尴尬的异常和崩溃。我检查过的许多不同工作站上的典型 .log 文件充满了异常。我的日志中最后 10 个异常的一小部分选择:

1.

1.

java.lang.NullPointerException
        at org.eclipse.jst.jsp.core.internal.validation.JSPActionValidator.isElIgnored(JSPActionValidator.java:147)

2.

2.

java.lang.RuntimeException
        at org.eclipse.jface.viewers.ColumnViewer.checkBusy(ColumnViewer.java:763)

3.

3.

java.lang.ArrayIndexOutOfBoundsException: 38
        at org.eclipse.debug.internal.ui.viewers.model.FilterTransform$Node.addFilter(FilterTransform.java:67)

4.

4.

org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 302111.
        at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:171)

5.

5.

java.lang.NullPointerException
        at org.eclipse.jst.jsf.facelet.core.internal.cm.ElementCMAdapter.getLength(ElementCMAdapter.java:109)

6.

6.

Caused by: java.lang.NullPointerException
        at org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.WebappConfiguration.getConfigFilesFromContextParam(WebappConfiguration.java:184)

7.

7.

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'span' not found. (file:///mysystem/Eclipse.app/Contents/MacOS/com
/sun/faces/metadata/taglib/facelets_jsf_core.taglib.xml, 453, 52)
        at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)
        ...
        at org.eclipse.jst.jsf.facelet.core.internal.registry.taglib.TagModelLoader.loadFromInputStream(TagModelLoader.java:100)

8.

8.

java.lang.NullPointerException: No IModelProvider exists for project P/my_project of version: Utility Module
            at org.eclipse.jst.j2ee.model.ModelProviderManager.getModelProvider(ModelProviderManager.java:101

9.

9.

 java.lang.NullPointerException
            at org.eclipse.jst.j2ee.internal.deployables.J2EEDeployableFactory.clearCache(J2EEDeployableFactory.java:238)

10.

10.

org.eclipse.jst.jee.model.internal.mergers.ModelException: java.util.ConcurrentModificationException
        at org.eclipse.jst.jee.model.internal.mergers.EjbJarMerger.process(EjbJarMerger.java:79)

Note that these are just the last 10, there are many, many more exceptions.

请注意,这些只是最后 10 个,还有很多很多例外。

The casual reaction would be: "Your Eclipse install is corrupted! You have a local problem!" Yes, I might have a local problem, but this "local problem" seems widespread as many Eclipse installs I inspected seem to have this stuff in their logs.

不经意的反应是:“你的 Eclipse 安装已损坏!你有一个本地问题!”是的,我可能有一个本地问题,但这个“本地问题”似乎很普遍,因为我检查的许多 Eclipse 安装似乎在他们的日志。

I'm also having problems with deployments like reported at the following link in various incarnations: http://community.jboss.org/thread/158611It may be JBoss tools specific or it may be based on the underlying WTP or even Eclipse code. I don't know, but I do know it's a nasty problem. Every WTP and JBoss tools version there is 'something' fixed, and every version a problem like that resurfaces in a slightly different form.

我也遇到了部署问题,如以下链接中报告的各种化身:http: //community.jboss.org/thread/158611它可能是特定于 JBoss 工具的,也可能基于底层 WTP 甚至 Eclipse 代码. 我不知道,但我知道这是一个令人讨厌的问题。每个 WTP 和 JBoss 工具版本都有固定的“某些东西”,并且每个版本都会以稍微不同的形式重新出现类似的问题。

Between the stability problems I'm able to get some work done and I love the auto completion and navigate-into features the editors offer me (which keeps me from switching to a text editor and building completely on the command line), but I sure would love some increased stability.

在稳定性问题之间,我能够完成一些工作,我喜欢编辑器为我提供的自动完成和导航功能(这使我无法切换到文本编辑器并完全在命令行上构建),但我确定会喜欢一些增加的稳定性。

回答by Allen Chee

To answer the following question: Do you have some best practices to speed it up, especially for upper-mid-sized like ours?

回答以下问题: 您是否有一些最佳实践可以加快速度,尤其是对于像我们这样的中上型企业?

Turning off validation and auto-building after file-saving is a good start to increase performance.

保存文件后关闭验证和自动构建是提高性能的良好开端。

回答by Aaron Digulla

I've disabled the WTP JSP editor for the reasons you mentioned above: It just needs too many resources. Some more things you should consider:

由于您上面提到的原因,我禁用了 WTP JSP 编辑器:它只是需要太多资源。还有一些你应该考虑的事情:

  1. Edit JSPs in the normal HTML editor. That means you don't get code completion which is a good thing. IMO, Mixing Java and HTML is a mistake in the first place and an editor can't fix that. Put all Java code into helper beans (which you can then test easily) and just access the beans from JSP. This should get rid of 99% of all the <% %>tags and solve most of your problems already.

  2. Consider using Spring to be able to build more complex beans and inject them into your JSPs using these patterns:

  3. Try a different VM. WTP editors creates huge amounts of objects and now all VMs (GC implementations) can handle that equally well. If you use Sun's Java, try JRockitor IBMs J9. Also play with the GC settings. Increasing RAM won't help because if you have GC issues, more RAM usually only makes it worse (since the GC will have to process more data).

  4. Precompile as much code as possible. You don't need 4000 classes open at all times on your workspace. Cut your huge project into manageable chunks.

  5. Replace JSPs with plain Java servlets and use HTML rendering libraries like rendersnakeor use a programming language which plays more nice with HTML (like Groovy).

  6. Get some decent hardware. A new PC with a quad core and 8GB RAM costs $1000. If you save ten minutes every day, the investment will be paid up in 50 days (at the rate of 1 person costs $1000/day all in all).

  7. Try MyEclipsewhich has much better web editors. The JSP editor is better than WTP (code completion works most of the time, for example) but it's still sluggish.

  1. 在普通 HTML 编辑器中编辑 JSP。这意味着你没有得到代码完成,这是一件好事。IMO,混合 Java 和 HTML 首先是一个错误,编辑器无法修复。将所有 Java 代码放入辅助 bean(然后您可以轻松测试),然后只需从 JSP 访问 bean。这应该可以去掉 99% 的<% %>标签,并且已经解决了你的大部分问题。

  2. 考虑使用 Spring 来构建更复杂的 bean 并使用以下模式将它们注入 JSP:

    • 如何将 spring bean 注入 jsp 2.0 SimpleTag?
    • 使用 SpringBeanAutowiringSupport:

      <%!
          @Autowired
          private Bean bean;
      
          public void jspInit() {
              SpringBeanAutowiringSupport
              .processInjectionBasedOnServletContext( 
                  this, getServletContext()
              );
          }
      %>
      
  3. 尝试不同的 VM。WTP 编辑器创建了大量对象,现在所有 VM(GC 实现)都可以同样好地处理这些对象。如果您使用 Sun 的 Java,请尝试JRockitIBMs J9。还可以玩 GC 设置。增加 RAM 无济于事,因为如果您遇到 GC 问题,更多的 RAM 通常只会让情况变得更糟(因为 GC 将不得不处理更多数据)。

  4. 预编译尽可能多的代码。您不需要在工作区中始终打开 4000 个课程。将您的庞大项目切成可管理的块。

  5. 用普通的 Java servlet 替换 JSP 并使用 HTML 渲染库(如rendersnake)或使用更适合 HTML 的编程语言(如Groovy)。

  6. 得到一些像样的硬件。具有四核和 8GB RAM 的新 PC 售价 1000 美元。如果每天节省十分钟,投资将在50天内付清(按1人计算,总共花费1000美元/天)。

  7. 试试MyEclipse,它有更好的 Web 编辑器。JSP 编辑器比 WTP 好(例如,代码完成大部分时间都可以工作),但它仍然很慢。

回答by Ralph

WTP (3.2.3) is slow for me too. I belive I have found some ways to make it not so slow:

WTP (3.2.3) 对我来说也很慢。我相信我已经找到了一些方法来让它不那么慢:

  • We use maven, so there is a targetdirectory which contains a copy of all JSP's and some other XML's. I have recognized that they are sometimes scanned by the WTP validators. But this is not necessary, so I have excluded them from validation (Project/Properties/Validation/XXX/Exclude Group/). (You should be able to gain the same effect when marking the targetdirectory as derived, but that does not work for me some times ;-()
  • I have made the (not scientifically proven)observation, that WTP seems to be faster with JSPX than JSP files.
  • 我们使用 maven,所以有一个target目录包含所有 JSP 和一些其他 XML 的副本。我已经认识到它们有时会被 WTP 验证器扫描。但这不是必需的,因此我已将它们从验证中排除(Project/Properties/Validation/XXX/Exclude Group/)。(target目录标记为派生目录时,您应该能够获得相同的效果,但这有时对我不起作用;-()
  • 我进行了(未经科学证明的)观察,JSPX 的 WTP 似乎比 JSP 文件更快。

回答by Werner

If you need barebones Java EE then you are better off with Netbeans, if you need everything but just working you are better off with IDEA. It is as simple as that.

如果您需要准系统 Java EE,那么您最好使用 Netbeans,如果您需要一切但只是工作,那么您最好使用 IDEA。它是如此简单。

回答by Andrew

By far the best way for speeding up my projects has been to precompile code that I am not currently using. We have about 20 projects that make up our system and when working on any specific problem I'm only touching a specific subset of those java files. Compiling most of the code that I won't be touching and throwing it into some .jar's, then using that as the source instead of including the projects has proven to speed up things by quite a bit. I imagine it will help you as well if you have 4k+ files. Each project just has a little build.xml that will make a jar out of it to include.

到目前为止,加速我的项目的最好方法是预编译我目前没有使用的代码。我们有大约 20 个项目组成了我们的系统,在处理任何特定问题时,我只涉及这些 java 文件的特定子集。编译大部分我不会接触的代码并将其放入一些 .jar 文件中,然后将其用作源代码而不是包含项目已证明可以大大加快速度。我想如果您有 4k+ 文件,它也会对您有所帮助。每个项目都只有一个小 build.xml,可以从中制作一个 jar 以包含在内。

As for the mind numbing slowness in the JSP editing. I have the same problems, it's just so dam slow. I don't have many more than 100 jsp files but I have the same issues as you. My solution has just been to throw money at hardware, which I must admit I enjoy doing :P.

至于JSP编辑的麻木慢。我也有同样的问题,就是太慢了。我没有超过 100 个 jsp 文件,但我和你有同样的问题。我的解决方案只是在硬件上花钱,我必须承认我喜欢这样做:P。