如何加快eclipse项目'刷新'

时间:2023-01-13 16:04:42

I have a fairly large PHP codebase (10k files) that I work with using Eclipse 3.4/PDT 2 on a windows machine, while the files are hosted on a Debian fileserver. I connect via a mapped drive on windows.

我有一个相当大的PHP代码库(10k文件),我在Windows机器上使用Eclipse 3.4 / PDT 2,而文件托管在Debian文件服务器上。我通过Windows上的映射驱动器连接。

Despite having a 1gbit ethernet connection, doing an eclipse project refresh is quite slow. Up to 5 mins. And I am blocked from working while this happens.

尽管拥有1gbit以太网连接,但进行eclipse项目刷新的速度非常慢。最多5分钟。在发生这种情况时,我被禁止工作。

This normally wouldn't be such a problem since Eclipse theoretically shouldn't have to do a full refresh very often. However I use the subclipse plugin also which triggers a full refresh each time it completes a switch/update.

这通常不会是一个问题,因为Eclipse理论上不应该经常进行完全刷新。但是我也使用subclipse插件,每次完成切换/更新时都会触发完全刷新。

My hunch is that the slowest part of the process is eclipse checking the 10k files one by one for changes over samba.

我的预感是,进程中最慢的部分是eclipse逐个检查10k文件以查看对samba的更改。

There is a large number of files in the codebase that I would never need to access from eclipse, so I don't need it to check them at all. However I can't figure out how to prevent it from doing so. I have tried marking them 'derived'. This prevents them from being included in the build process etc. But it doesn't seem to speed up the refresh process at all. It seems that Eclipse still checks their changed status.

代码库中有大量的文件,我永远不需要从eclipse访问,所以我根本不需要它来检查它们。但是我无法弄清楚如何阻止它这样做。我试过将它们标记为'派生'。这可以防止它们被包含在构建过​​程等中。但它似乎根本不会加快刷新过程。似乎Eclipse仍然会检查其更改状态。

I've also removed the unneeded folders from PDT's 'build path'. This does speed up the 'building workspace' process but again it doesn't speed up the actual refresh that precedes building (and which is what takes the most time).

我还从PDT的“构建路径”中删除了不需要的文件夹。这确实加快了“建筑工作空间”的过程,但同样不会加速建筑之前的实际刷新(这是花费最多时间的事情)。

6 个解决方案

#1


Thanks all for your suggestions. Basically, JW was on the right track. Work locally.

谢谢大家的建议。基本上,JW走在了正确的轨道上。在当地工作。

To that end, I discovered a plugin called FileSync: http://andrei.gmxhome.de/filesync/

为此,我发现了一个名为FileSync的插件:http://andrei.gmxhome.de/filesync/

This automatically copies the changed files to the network share. Works fantastically. I can now do a complete update/switch/refresh from within Eclipse in a couple of seconds.

这会自动将更改的文件复制到网络共享。非常有效。我现在可以在几秒钟内从Eclipse中完成更新/切换/刷新。

#2


Do you have to store the files on a share? Maybe you can set up some sort of automatic mirroring, so you work with the files locally, and they get automatically copied to the share. I'm in a similar situation, and I'd hate to give up the speed of editing files on my own machine.

你必须将文件存储在共享上吗?也许您可以设置某种自动镜像,因此您可以在本地处理这些文件,并将它们自动复制到共享中。我处于类似的情况,我不想放弃在我自己的机器上编辑文件的速度。

#3


Given it's subversioned, why not have the files locally, and use a post commit hook to update to the latest version on the dev server after every commit? (or have a specific string in the commit log (eg '##DEPLOY##') when you want to update dev, and only run the update when the post commit hook sees this string).

鉴于它是subversioned,为什么不在本地使用这些文件,并在每次提交后使用post commit hook在dev服务器上更新到最新版本? (或者当你想要更新dev时,在提交日志中有一个特定的字符串(例如'## DEPLOY ##'),并且只有当post commit hook看到这个字符串时才运行更新)。

Apart from refresh speed-ups, the advantage of this technique is that you can have broken files that you are working on in eclipse, and the dev server is still ok (albeit with an older version of the code).

除了刷新加速之外,这种技术的优点是你可以在eclipse中使用破坏的文件,并且开发服务器仍然可以(尽管代码的旧版本)。

The disadvantage is that you have to do a commit to push your saved files onto the dev server.

缺点是您必须提交将已保存的文件推送到开发服务器。

#4


Use offline folder feature in Windows by right-click and select "Make availiable offline".

在Windows中使用脱机文件夹功能,右键单击并选择“使可用脱机”。

It could save a lot of time and round trip delay in the file sharing protocol.

它可以在文件共享协议中节省大量时间和往返延迟。

#5


The use of svn externals with the revision flag for the non changing stuff might prevent subclipse from refreshing those files on update. Then again it might not. Since you'd have to make some changes to the structure of your subversion repository to get it working, I would suggest you do some simple testing before doing it for real.

使用带有修改标志的svn externals用于不更改的东西可能会阻止subclipse在更新时刷新这些文件。然后它可能不会。由于您必须对subversion存储库的结构进行一些更改才能使其正常工作,因此我建议您在进行实际操作之前先进行一些简单的测试。

#6


I solwed this problem by changing "File Transfer Buffer Size" at:

我通过更改“文件传输缓冲区大小”解决了这个问题:

Window->Preferences->Remote Systems-Files and change "File transfer buffer size"-s Download (KB) and Upload (KB) values to high value, I set it to 1000 kb, by default it is 40 kb

窗口 - >首选项 - >远程系统 - 文件并更改“文件传输缓冲区大小”-s下载(KB)和上传(KB)值为高值,我将其设置为1000 kb,默认为40 kb

#1


Thanks all for your suggestions. Basically, JW was on the right track. Work locally.

谢谢大家的建议。基本上,JW走在了正确的轨道上。在当地工作。

To that end, I discovered a plugin called FileSync: http://andrei.gmxhome.de/filesync/

为此,我发现了一个名为FileSync的插件:http://andrei.gmxhome.de/filesync/

This automatically copies the changed files to the network share. Works fantastically. I can now do a complete update/switch/refresh from within Eclipse in a couple of seconds.

这会自动将更改的文件复制到网络共享。非常有效。我现在可以在几秒钟内从Eclipse中完成更新/切换/刷新。

#2


Do you have to store the files on a share? Maybe you can set up some sort of automatic mirroring, so you work with the files locally, and they get automatically copied to the share. I'm in a similar situation, and I'd hate to give up the speed of editing files on my own machine.

你必须将文件存储在共享上吗?也许您可以设置某种自动镜像,因此您可以在本地处理这些文件,并将它们自动复制到共享中。我处于类似的情况,我不想放弃在我自己的机器上编辑文件的速度。

#3


Given it's subversioned, why not have the files locally, and use a post commit hook to update to the latest version on the dev server after every commit? (or have a specific string in the commit log (eg '##DEPLOY##') when you want to update dev, and only run the update when the post commit hook sees this string).

鉴于它是subversioned,为什么不在本地使用这些文件,并在每次提交后使用post commit hook在dev服务器上更新到最新版本? (或者当你想要更新dev时,在提交日志中有一个特定的字符串(例如'## DEPLOY ##'),并且只有当post commit hook看到这个字符串时才运行更新)。

Apart from refresh speed-ups, the advantage of this technique is that you can have broken files that you are working on in eclipse, and the dev server is still ok (albeit with an older version of the code).

除了刷新加速之外,这种技术的优点是你可以在eclipse中使用破坏的文件,并且开发服务器仍然可以(尽管代码的旧版本)。

The disadvantage is that you have to do a commit to push your saved files onto the dev server.

缺点是您必须提交将已保存的文件推送到开发服务器。

#4


Use offline folder feature in Windows by right-click and select "Make availiable offline".

在Windows中使用脱机文件夹功能,右键单击并选择“使可用脱机”。

It could save a lot of time and round trip delay in the file sharing protocol.

它可以在文件共享协议中节省大量时间和往返延迟。

#5


The use of svn externals with the revision flag for the non changing stuff might prevent subclipse from refreshing those files on update. Then again it might not. Since you'd have to make some changes to the structure of your subversion repository to get it working, I would suggest you do some simple testing before doing it for real.

使用带有修改标志的svn externals用于不更改的东西可能会阻止subclipse在更新时刷新这些文件。然后它可能不会。由于您必须对subversion存储库的结构进行一些更改才能使其正常工作,因此我建议您在进行实际操作之前先进行一些简单的测试。

#6


I solwed this problem by changing "File Transfer Buffer Size" at:

我通过更改“文件传输缓冲区大小”解决了这个问题:

Window->Preferences->Remote Systems-Files and change "File transfer buffer size"-s Download (KB) and Upload (KB) values to high value, I set it to 1000 kb, by default it is 40 kb

窗口 - >首选项 - >远程系统 - 文件并更改“文件传输缓冲区大小”-s下载(KB)和上传(KB)值为高值,我将其设置为1000 kb,默认为40 kb