2 ms·
Java might be fast once it's had time to warm up, but its startup time is impressive only in how excruciatingly slow it is. I wrote a small utility program in
by ptx 8y ago
Java might be fast once it's had time to warm up, but its startup time is impressive only in how excruciatingly slow it is.
I wrote a small utility program in Java recently. It was getting slower and slower as it grew, so I profiled it. It turned out the slow parts were every part - the first time that part executes. E.g. parsing the command line arguments was slow the first time, but fast if I did it a second time. Same for reading configuration files, opening sockets, etc. I assume this has to do with a combination of lazy class loading (which is slow) and the JIT compiler not being warmed up.
Unfortunately for Java (and its users), you rarely need to parse your arguments a second time, so you never get to experience the case where Java is fast. It needs to be fast the first time, and it's not.