I noticed that the startup time of a minimal console application in Java is slightly more than 100 ms on my machine compared to 1 ms of an equivalent C application. Although it is not a problem in most cases I would like to find out if there is a way to reduce this time because I need to write an application that will be executed many times (say in a loop within a bash script).
Share
You asking for the “Achilles’ heel” of Java. There is really not much to do with it. The last Java version will be the most performant, they are working for years on that issue.
Anyway running the same program several times you will notice that after first startup the next is much more faster. I think that comes from the OS caching mechanism.
The only real way to make it better is to let run your app in background and comunicate with your app maybe thru a web service (that is what servelet container is all about).
100ms not sounds too much but could be unacceptable in your case.