Java – why mine Jar files run slower than programs in eclipse?

I have a java program that reads a large amount of input data from the database, operates on it, and then writes the data back to another database (using ODBC driver, Excel and accessing the database, on the new windows 7 machine) The program takes about 17 minutes to run from eclipse, but when I create an executable Jar file, it takes an extra 10 minutes to run (a total of 27 minutes)

So far, I've found that two reasons for slow jar files (by searching so and Google) are that they are compressed and take longer to write to the command prompt (or error log) than the console in eclipse I tried to create an uncompressed jar file, and it only accelerated by about 10 seconds (this may be completely random because the running time is about 30 seconds apart) I have only about 10 systems in the program out. Println () command, so it should not be slowed down

Any idea of what caused it to run so slowly, if there is any way I can accelerate again? Please let me know if there are any other details that I should include thank you!

Solution

Use jamon

After adding some monitoring code to the method, run it in eclipse as a jar file and compare the results This should allow you to narrow your search

Also: check that you are running the jar file using the same java version as eclipse (for example, Java 1.4. X may be much slower than 1.6. X)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>