Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program execution in Eclipse is very slow when compared to command prompt

Tags:

java

eclipse

I have created a Java program which reads encrypted files from local system and does some processing. Actually I have 20 files to read so I have used threading mechanism to speed up the program execution.

When I run the program in Eclipse it takes more than 30 minutes to complete the execution, whereas if I make a runnable jar and execute the program using command prompt, it takes less than a minute.

Why does running programs in Eclipse take more time than running them in command prompt?

like image 783
Ran Avatar asked Feb 19 '23 22:02

Ran


1 Answers

Eclipse's Console view that captures System.out is notoriously slow compared to the regular stdout of the command line. Whenever there is a lot of printing happening in the program, it is to be expected that the program will run significantly slower from Eclipse.

But anyway, unless you are writing a program designed to integrate with other programs via Unix pipes, you should minimize the printing as it will kill performance even at the command line.

like image 76
Marko Topolnik Avatar answered Feb 27 '23 10:02

Marko Topolnik