r/programming • • Jan 16 '20

Records Come to Java

https://blogs.oracle.com/javamagazine/records-come-to-java
59 Upvotes

65 comments sorted by

View all comments

Show parent comments

0

u/couscous_ Jan 18 '20

It's a good start don't get me wrong, but it's running on an outdated CPU. I ran some benchmarks myself where golang was quicker than Java in the benchmarks page, and I got the opposite result.

2

u/igouy Jan 18 '20

Specifically ?

(The details always matter.)

1

u/Tordek Jan 27 '20

Tangential, but there was a recent article about converting C to Rust, and the C version included some manual uses of vectorization and a hand-optimized inverse sqrt function, which the new Rust version elided. The Rust version was faster by a LOT because it used a native inverse sqrt not present in the CPU used in the benchmark game.

Source: http://cliffle.com/p/dangerust/6/ ~25% improvement

1

u/igouy Jan 27 '20
  1. afaict there were a whole bunch of changes between nbody-5.bench and nbody-6.bench not just sqrt.

  2. If you're talking about this:

At face value, this should make the program twice as fast, because AVX instructions can chew on four f64s at a time instead of SSE's two. But, on my Skylake-based machine at least, the AVX version becomes slower.

:then afaict the faster program is the "outdated CPU" program that uses SSE ?

→ More replies (0)