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?
Eclipse’s Console view that captures
System.outis notoriously slow compared to the regularstdoutof 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.