3 ms·
Rather strange rant. I hope it was trying to be funny, but if so, it failed miserably. Anyway, what I find interesting is that Java really is very slow in one
by jpr 17y ago
Rather strange rant. I hope it was trying to be funny, but if so, it failed miserably.
Anyway, what I find interesting is that Java really is very slow in one thing: startup time. My completely unscientific test concluded that a hello world -program in written in Java takes about 0.110 seconds to run, while the C version took about 0.003 seconds. What's interesting, Python version takes about 0.015 seconds, which includes parsing, compiling to bytecode and interpreting it, while the Java version has already been parsed and compiled. I would like to know what explains this almost tenfold difference between Java and Python startup times. I suspect it might have to do with the security features of Java?
- makecheck 17y agoIf you ran the Python version more than once, check for a new file with a "c" suffix; that could skew your performance measurement.
- scumola 17y agoI'm the author of the original post. cross-platform benchmarks like this typically don't represent real-world apps. They're usually tiny benchmarks that test one or two things, but don't really hit the nail on the head when it comes to resource bloat or garbage collection or things that happen to an application that runs for days, weeks or months at a time. Yea, startup time is going to be faster in C or C++ because there isn't anything to start up. C just starts running and after the OS has the application scheduled, it starts doing real work, not pre-allocation of things and all of the overhead that's involved with languages like java, python, ruby, perl, ... For small applications, startup time is important. In unix/linux, when you string a bunch of apps together on a command-line, startup time is very important. So, don't dismiss startup time. Secondly, let's talk socket pools, file handle pools, garbage collection, and all of the many things that java gives you to get better performance out of a language that is literally the elephant (bloated, slow thing) in the room.