News for hackers. Stuff that matters.
Re:Why is this Go faster than the equivalent Java? by akvadrako on Saturday April 01, 2017 @05:17AM (#14011309)
Java is still slow in practice, particularly due to poor startup times, due to things like class scanning and the ecosystem of bloated libraries.
Re:Why is this Go faster than the equivalent Java? by pjmlp on Saturday April 01, 2017 @05:38AM (#14011366)
Only by those that don't have experience in Java tooling.

High startup costs you say? Then don't use OpenJDK.

Get an AOT compiler to native code like Excelsior Jet or switch to a JVM that supports both AOT compilation to native code and JIT code caching like IBM J9 or Azul.

class scanning ? Again stop using OpenJDK and switch to a JVM that supports class sharing across VM instances like IBM J9.

For those that don't want ever to use anything other than OpenJDK, some of those features might eventually come there, like the newly introduced support for AOT compilation of the base module for Linux x64. With everything else planned for Java 10.

Bloated libraries? Well, there are bloated libraries in any programming language.

And by any change you are thinking of JEE, I doubt you had the pleasure to use C or C++ alongside DCOM, CORBA and SUN RPC, at enterprise level to fully understand the relief it was to change to JEE.

Re:Why is this Go faster than the equivalent Java? by cturner on Saturday April 01, 2017 @08:34AM (#14011815)
Java is not slow in practice. Many top trading systems have been written in it, including the excellent and widely licensed nasdaq architecture (omx, singapore, asx, swx, etc) and the independently designed Lmax Disruptor. You do not have to use any library you don't want to. there is nothing stopping you from building everything in preallocated byte arrays, and never triggering gc. Nio2 is fast. Jvm is a leading foundation of fast, complex distributed systems, particularly if you need multiple programmers working on a single source tree.
Re:Why is this Go faster than the equivalent Java? by ycombobreaker on Saturday April 01, 2017 @03:04PM (#14013583)
In my experience NASDAQ's system is both a stellar example of law-latency Java and, due to its rarity, a demonstration of the apparent difficulty. Every other trading system I have seen implemented in Java has suffered noticably from poor memory management (too much GC-related variance). I would expect that Nasdaq approaches their trading software much more like an embedded system, at which point the engineering discipline and mastery of the playform matters much more than the language.

Also as mentioned elsewhere in the thread, trading systems don't suffer from frequent cold restarts, so hotspot work amortizes extremely well. So Java is much more optimal there than e.g. a command line tool.

Re:Why is this Go faster than the equivalent Java? by rusk on Saturday April 01, 2017 @09:08AM (#14011924)
Yes Java is as quick as anything else once it is up and running; the point GP was making was getting to this warmed up state is what makes people perceive java as slow.
Re:Why is this Go faster than the equivalent Java? by cturner on Saturday April 01, 2017 @10:00AM (#14012143)
You wrote about preceptions in another part of the thread. But that's not what I replied to. The words are above, and it wasn't about perceptions.

But on perceptions: naive perceptions don't justify a false statement. So why draw focus to them, why excuse them? Facts trump perceptions.

Re:Why is this Go faster than the equivalent Java? by rusk on Saturday April 01, 2017 @03:18PM (#14013646)
Really? I see perceptions Trump fact all the time …
Re:Why is this Go faster than the equivalent Java? by pjmlp on Saturday April 01, 2017 @09:19AM (#14011961)
A situation that only occurs if one doesn't make use of JVM that cache JIT code like IBM J9, or willing to pay for an optimizing AOT compiler like Excelsior JET.

Also another example is those that perceive the JVM as slow due to using it with Clojure, when the slowness in this case is caused by the Clojure implementation itself.

Re:Why is this Go faster than the equivalent Java? by matwood on Saturday April 01, 2017 @09:59AM (#14012141)
Even without special compilers, most people are using java on the server. Startup time happens once on deploy.
Re:Why is this Go faster than the equivalent Java? by akvadrako on Tuesday April 11, 2017 @12:03PM (#14089364)
...and much more frequently during development.
Re:Why is this Go faster than the equivalent Java? by rusk on Saturday April 01, 2017 @03:17PM (#14013642)
True but these approaches have never been marketed as part of the java experience
Re:Why is this Go faster than the equivalent Java? by pjmlp on Saturday April 01, 2017 @04:27PM (#14014001)
Only by those that aren't doing Java programming.

I use Java since the very early days, and am well aware of them, as are my fellow Java developers, when I work in Java projects.

Re:Why is this Go faster than the equivalent Java? by rusk on Monday April 03, 2017 @08:22AM (#14022222)
Aren't you great. As a java developer I am well aware of them too. For most people java == java applets; or "hello world" with `javac Hello.java` and then `java -cp. Hello` followed by some interminable wait while all the apparatus of the JVM is marshalled for the sole purpose of emitting a static string and then exiting. And by interminable I mean 2 or 3 second but still.

Even in more enlightened scenarios a REPL on jruby is just eye-wateringly painful unless you've all the "secret speedups" enabled.

In many more modern development cultures such secrets are generally looked upon as "Yak Shaving".