Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When built from eclipse, why is a java program slower than when built from command line?

I did some simple function call and string operation in a loop, the java program runs much faster under command line than launching ( Run as... ) from eclipse...

6 lines of output were printed, each line is around 120 characters. each line is a perf result ranges from 50ms to 300ms.

The total time is a little more than 2 seconds.

"much slower" here means, for certain operations ( function call ), I see 20ms vs 300 ms.

After running on console once, the speed on eclipse catches up!

After I change and build the code in eclipse, the speed on CL will drop if I don't rebuild it with command line.

Looks like some hotspot information is only generated with CL...

like image 747
Tom Fishman Avatar asked Nov 15 '11 20:11

Tom Fishman


People also ask

Why is my Eclipse running so slow?

If there are too much data in the eclipse local history folder then it can make the eclipse project run slower and slower. You can find the eclipse local history data at your eclipse workspace folder . metadata/. plugins/org.


1 Answers

Maybe it is just the eclipse console that is slower than your operating systems console? Plus, at a total runtime of ~2 seconds, your benchmark probably is just super inaccurate.

like image 95
Has QUIT--Anony-Mousse Avatar answered Oct 06 '22 04:10

Has QUIT--Anony-Mousse