Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've been programming for about 2 years, and so far Java is all I know.

When I made the switch from BlueJ to eclipse I noticed my old projects ran much faster. What would be the reason for this, as far as I knew the executing of java byte code is handled by the JVM and I still had the same JVM after I switched. Other than that does eclipse have had a different compiler? That's the only other thing I could think of.

Edit:

I timed it, the average runtime for, we'll call it A(100), in blueJ was 1 Minutes; 8 Seconds; 846 Milliseconds. In eclipse A(100) only took 8 Seconds; 459 Milliseconds. I've also noticed the increase for all my other programs too. I haven't measured those yet but the difference is definitely noticeable.

A() is a function that does alot of computation than prints of a chart of information based on what it found, fyi.

share|improve this question
1  
Did you measure this or is just a subjective impression? –  Vitor Jul 10 '11 at 1:25
    
Eclipse uses it's own compiler, though I don't know how much of a difference it would actually make. –  R0MANARMY Jul 10 '11 at 1:30
1  
Yes, Eclipse has its own compiler and it could optimize particular things for you quite well. It also runs the program in its own console. What you're experiencing might just be the speed of the console, as you didn't specify what kind of program you're running. –  Macneil Jul 10 '11 at 1:34
3  
Could be that since BlueJ is a teaching environment and not just a Java development studio it's doing a lot of extra things behind your back, too. –  Patrick Hughes Jul 10 '11 at 1:35

1 Answer 1

up vote 4 down vote accepted

I think the main reason is that BlueJ runs your code in a VM with a debugger attached. BlueJ actually has two VMs running: the main one, and the one with your code inside (the user VM, aka the debug VM). The main VM has a debugger attached to the user VM, which allows it to do things like pause user code, inspect the state of objects and all sorts. I imagine this probably adds a fair bit of overhead (perhaps inhibiting the JIT compilation?); the speed that code executes is not a major concern for a learning environment like BlueJ, as long as it's reasonable.

share|improve this answer
    
Does eclipse do the same thing? You can debug you code in eclipse as well. –  Ratz Jul 11 '11 at 15:51
    
Eclipse lets you run in either normal or debug mode. I've noticed that the debug mode can be a bit slower in some cases. –  mikera Jul 11 '11 at 17:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.