3 ms·
It's a bit amusing that "why is Java so slow" is in there. I have to think that's coming from people who are familiar with Java from the horrible Java browser
by bhauer 12y ago
It's a bit amusing that "why is Java so slow" is in there. I have to think that's coming from people who are familiar with Java from the horrible Java browser plug-in rather than server-side Java.
- TacticalCoder 12y agoJava is quite fast compared to most languages but for some things it is still terribly slow compared to C / C++. I had to do some big integers crunching lately and tried: Java, Go, Go with GMP, C (GMP) and Haskell (using GMP under the hood). Eventually I went for good old C with the latest GMP version for it was the fastest for my use case (with Haskell and Go with GMP coming close but still not as fast as C). Java was, for the computation I needed to do... Eight times slower than C! I know I was hitting a edge case for a very specific kind of computation but still. The situation is so bad that there are people who wrote wrappers calling GMP from within Java. I think some Java devs don't realize how slow some of the Java API are for certain tasks. For example there's no way Java BigInteger can compete with GMP and there's no way GMP is getting ported to Java anytime soon (GMP is open source: just go and look at some of the optimization going on and you'll see what I'm talking about). Most Java devs don't realize how complex and optimized some libraries out there are and how low-level you need to go when you need the utmost performance. Sure, server-side Java is fast for most things it's used for. But not everything is "server-side" and there are several domains where Java simply doesn't cut it compared to good old C + assembly. And people finding Java being nearly one order of magnitude slower than the alternative for some tasks may be tempted to ask "Why is Java so slow...". Now this isn't a criticism of Java: Java is the language I know best and used (and still use) the most. And I know it well enough to know when it's probably a good idea to try to find an alternative.
- jbooth 12y agoLast time I checked and did the math, I counted about 500 bytes of overhead in a java BigInteger. Still, I wouldn't call that "java being slow", more, "java having a god awful BigInteger library class".
- chc 12y agoJava is still relatively sluggish until it gets rolling. Any realistic Java benchmark has to spend a good amount of time just convincing the JVM to start being serious before the benchmarks will give good results. So for people whose use cases look more like "small tool" than "web app," Java can still appear rather slow.
- josephlord 12y agoI understand that Java is fast for long running processes that can live in memory. That describes "server-side" environments pretty well but the experience for desktop apps, commandline utilities and many other forms of computing is rather different.
- bitwize 12y agoJava takes a long-ass time to fire up and get going. If startup time is significant compared to runtime (as for a command line utility, say), Java can indeed be perceived as very slow.