如何使使用Eclipse的体验更快?

例如:我禁用了所有我不需要的插件(Mylyn, Subclipse,…)

我没有为Mercurial使用插件,而是将TortoiseHG配置为一个外部工具。


当前回答

这篇文章如何快速使eclipse更快是非常有用的。我尝试了一些技巧,这是真的;它使我的Eclipse运行得更快。

其他回答

对Eclipse速度影响最大的三个因素是:

使用最新版本的Eclipse(2020-06截至2020年6月26日) 请注意David balaicic的评论(2014年7月)与六年前的标准相矛盾:

Indigo (3.7.2) SR2中“相同”的工作空间在4秒内加载,Kepler SR2(4.3.2)在7秒内加载,Luna(4.4.0)在10秒内加载。它们都是Java EE包。新版本有更多捆绑的插件,但趋势仍然很明显。(我所说的“相同”工作空间是指:使用相同的(额外安装的)插件,从版本控制中检出相同的项目)。

使用最新的JDK启动它(在撰写本文时使用Java 14,这并不妨碍您在Eclipse项目中使用任何其他您想要的JDK: 1.4.2、1.5、1.6旧版本……) vm jdk1.6.0_10 \ jre \ bin \ client \ jvm.dll 配置eclipse.ini(有关完整的eclipse.ini,请参阅这个问题) -Xms512m -Xmx4096m […]

Xmx参数是Eclipse将获得的内存量(简单来说)。使用-Xmx4g,它可以获得4gb的RAM,等等。


注意:

引用jvm.dll有以下优点:

启动画面很快就会出现。 进程列表中的Eclipse.exe,而不是java.exe。 防火墙:Eclipse需要访问Internet而不是Java。 窗口管理品牌问题,特别是在Windows和Mac上。


2020年12月,Udo符合评论

From version 4.8 (Photon) an up there was a steady speed gain after each version. The main platform was optimized every release to load faster, enable more features for the dark theme and to add more features for newer Java versions for the Java development tools. Especially with-in the last 3 versions the startup time was increased a lot. There should be a significant increase in start-up time with the newest version of Eclipse 2020-12. In my experience it started a lot faster with each new version. But: There are still plug-ins which do not follow the new way of using the Eclipse API and are therefore still slow to start. Since the change to Java 11 as the minimum runtime version starting from Eclipse version 2020-09 at least the core system uses the newer features of the JVM. It is up to the providers of the other plug-ins to upgrade to newer APIs and to use the full power of modern CPUs (e.g. concurrent programming model).

另请参阅

为Eclipse提供正确数量的线程和正确数量的内存:问题:Eclipse和Eclipse索引器占用了我所有的资源/ CPU%

你有大的公羊吗?创建一个ramdisk,并把你的

JDK JVM Eclipse 工作空间

确保将更改保存回HDD或提交给VCS,以避免断电时数据丢失。

虽然与Eclipse没有直接关系:

如果你运行的是Windows 7(可能还有Windows Vista),如果你的东西在默认的位置——你的主文件夹里,一定要禁用工作空间文件夹的文件索引。Windows默认会索引你主文件夹中的所有内容,这对你的工作空间来说是一种浪费。(右键单击资源管理器中的工作区文件夹,属性->高级。)

Windows用户:

If you go to Task Manager, choose the eclipse application, and click on the little arrow next to it, you will usually just see one sub-process appear below "eclipse.exe". However, in my case, if you have multiple instances of "Java Platform SE Binary", then end all of them. For some reason, I had three of these running in the background, even though I wasn't currently running any projects. Nevertheless, this will boost performance back to the way it likely was when you first installed eclipse on your computer.

如果更改后您不能再运行项目,那么尝试重新启动eclipse。

如果您因为工作等原因没有绑定到Eclipse,您需要的某些插件功能只能通过Eclipse使用等等;那么一个可能的策略就是完全摆脱Eclipse。这将极大地加快速度。

您可以切换到任何其他IDE或开发环境,以满足您的需要。NetBeans就是一个例子。一些提议的加速也适用于NetBeans,或任何其他IDE。

一个直接应用于Linux的例子是尽可能多地移动到tmpfs挂载。在NetBeans中进行Java开发时,我将Java文档和源代码移到了tmpfs挂载中,这极大地提高了性能。

同样,在c++开发过程中,如果可能的话,我将确保整个源代码树都在我的tmpfs挂载中。虽然我还没有对构建性能进行广泛的基准测试,但在合理大小的代码库(几百个源文件+头文件)上进行了一些测试,结果导致编译时间减少了50%。

请记住,使用此方法时,您的数据在断电期间不会持久。为了解决这个问题,可以创建一个脚本,将tmpfs挂载到某个备份目录,并将该脚本添加为每分钟运行一次的cronjob。