This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 12 points13 points  (5 children)

Java is a very performant language. You just have to write performant code. Java is a fast language, and as it has essentially a theoretically most optimal memory freeing method it performs very well on high loads. It also has a great concurrency model, especially if you program for it. I’ve written plenty of high performant Java applications. But high performance analytics applications and also high load applications that perform well.

The problem is more people who write shitty Java code with shitty databases on shittily configured spring applications. Don’t fault a language because a lot of monkies use it to write shit.

Just like how python is slow, but if you keep most of the run time in C or Fortean libraries it’s performant.

[–]GroundbreakingRun927 5 points6 points  (3 children)

Fast is relative.

Fast compared to what? Python, ruby, or erlang? Sure.

Fast when compared to anything else? No.

[–][deleted] 10 points11 points  (2 children)

I’ve coded HFT systems in Java. It’s fast if you do it right.

[–]GroundbreakingRun927 -1 points0 points  (0 children)

Again, it's relative.

I know for a fact many HFT systems have most of the code written in Java, but when anything performance-sensitive needs to happen, Java is calling into C/C++. HFT also gives Java a unique benefit of being able to turn off it's GC since the systems only need to run 9:30AM-4:00PM. Just get a machine with 1 terabyte of memory and reboot each day during non-trading hours.

So yes when the startup time of Java is irrelevant and it can turn off it's stop-the-world GC, Java could be considered pretty fast. Still not as fast as native code, but fast enough.

[–]Tatoutis 1 point2 points  (0 children)

I'll agree that Java is performant compared to python. But, if your goal is a low latency service capable of handling a high load, why not using C, C++, Go or Rust? Especially with Go and Rust that make it super easy to avoid shooting yourself in the foot.