eclipse 如何加速eclipse项目“刷新”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/423270/
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
How to speed up the eclipse project 'refresh'
提问by EvilPuppetMaster
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 的“构建路径”中删除了不需要的文件夹。这确实加快了“构建工作区”过程,但同样不会加快构建之前的实际刷新(这是最耗时的)。
采纳答案by EvilPuppetMaster
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 中完成一个完整的更新/切换/刷新。
回答by JW.
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.
您必须将文件存储在共享上吗?也许您可以设置某种自动镜像,以便您在本地处理文件,然后它们会自动复制到共享中。我处于类似的情况,我不想放弃在自己的机器上编辑文件的速度。
回答by Cebjyre
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).
鉴于它已被颠覆,为什么不在本地保存文件,并在每次提交后使用提交后挂钩更新到开发服务器上的最新版本?(或者当你想更新 dev 时,在提交日志中有一个特定的字符串(例如'##DEPLOY##'),并且只有在提交后挂钩看到这个字符串时才运行更新)。
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.
缺点是您必须提交才能将保存的文件推送到开发服务器上。
回答by Dennis C
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.
它可以在文件共享协议中节省大量时间和往返延迟。
回答by Cebjyre
The use of svn externalswith the revision flag for the non changing stuff mightprevent 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 存储库的结构进行一些更改才能使其正常工作,因此我建议您在真正执行之前先进行一些简单的测试。
回答by Kaxa
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
Window->Preferences->Remote Systems-Files 并将“文件传输缓冲区大小”-s 下载 (KB) 和上传 (KB) 值更改为高值,我将其设置为 1000 kb,默认情况下为 40 kb