9

I am doing TDD on a large Java project in eclipse and am finding it frustrating because every time I run a test I have to wait 30 seconds+ for eclipse to compile and refresh. I estimate that 80%+ of that time is spent refreshing.

Is there a way I can drastically reduce the amount of refreshing it is doing? I have looked at server other similar questions but I could not see anything that helps.

One way I reduced the compile refresh time was to split the unit tests and code into separate projects. There are 4,700 classes in the src project and 300 in the tests. I am running eclipse 3.5.1 on Java 1.6.0_17-b04 (eclipse.vm). My computer is running windows xp with 3.1 gigs of usable ram. The only plugin I have installed is subclipse.

nash
  • 3,020
  • 6
  • 38
  • 53
  • Can you break down what you do during each iteration? Like: 1. Write a failing test. 2. Project > Build Automatically is checked, so I wait for the test to compile. 3. Run the test to confirm that it fails. 4. Write code to fix the failing test. 5. Wait for the project to auto-build. 6. Run the test to confirm the fix actually fixed the test. I'm having a hard time understanding how running a test is triggering a compile. Also, can you be more specific about what needs to be refreshed each time? – Rob Heiser Mar 26 '10 at 20:44
  • @Rob Heiser - To test the build / refresh speed I make a minor change to a src file, like change a static final number to an incorrect value, then run a unit test. – nash Mar 27 '10 at 16:37
  • The problem does not seem to be memory related - I first tried setting -Xmx1000m in eclipse.ini, then -Xmn100m -Xms512m -Xmx700m -Xss4m -XX:PermSize=400M -XX:MaxPermSize=500M as was suggested in another question. Neither had any effect. – nash Mar 27 '10 at 16:42
  • Try using the server VM too (not sure if Eclipse does this by default). -server in eclipse.ini. Also, make sure you have any projects you're not working on closed. – Chris Dennett Mar 27 '10 at 21:12

4 Answers4

5

I significantly increased the performance of Eclipse under 32-bit Windows by creating a RAM disk using the portion of the OS-unadressable memory as illustrated here.

If you have (or can increase to) 4GB of ram from your current 3.1 the same approach will quite possibly help you.

Community
  • 1
  • 1
Eric J.
  • 147,927
  • 63
  • 340
  • 553
3

Have a look at the post I made here about eclipse.ini options: Eclipse IDE speed sluggish on Snow Leopard Macbook. Some of these might help you as they can adjust Eclipse environment settings (allocate more memory, etc). Also consider migrating your workspace to a faster disk :)

Community
  • 1
  • 1
Chris Dennett
  • 22,412
  • 8
  • 58
  • 84
1

This could definitely be memory related. See one of:

They both give a good overview on Eclipse memory configuration, which I think will at least help with this issue.

Community
  • 1
  • 1
stevedbrown
  • 8,862
  • 8
  • 43
  • 58
1

It turns out there were build errors in the project that did not affect the tests or the code I was working on but were there none the less. When I resolved all build errors in my eclipse workspace the issue with long refreshes when away. This was tested on eclipse 3.5 and 3.6.

I feel a little foolish now :(, but from what I have seen professionally there are a lot of people with lingering IDE build issues.

nash
  • 3,020
  • 6
  • 38
  • 53