I have a java program that reads a lot of input from a database, manipulates it, and then writes the data back to another database (using ODBC drivers, excel and access databases) on a new Windows 7 machine). The program takes about 17 minutes to run from eclipse, but when I created the .jar executable, it takes another 10 minutes to start (27 in total).
Two reasons that I have found so far for slow jar files (by searching for SO and google) are that they are compressed and that it takes a lot of time to write to the command line (or error log) than the console in eclipse. I tried to create an uncompressed jar file, and it accelerated by about 10 seconds (which could be completely random, since the startup time varies by about 30 seconds). I only have about 10 System.out.println()
commands in the program, so this should not slow it down much.
Any ideas on what makes it work much slower, and if there is any way, can I speed it up again? Let me know if there are any other details that may matter that I should include. Thanks!
source share