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

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 ?

1

u/Tordek Jan 27 '20
  1. Yep, but see below.

  2. No, in fact the previous paragraph would be more relevant:

(You could make it faster, but non-portable, by re-introducing the reciprocal square root trick.)

Which is odd because I totally remembered the article replacing the reciprocal sqrt optimization and finding it faster. (Also a bit ironic that the article says to measure yet doesn't in that particular case).

1

u/igouy Jan 27 '20

I'm failing to see why you think:

(You could make it faster, but non-portable, by re-introducing the reciprocal square root trick.)

:means "faster … because it used a native inverse sqrt not present in the CPU used in the benchmark game".

Maybe just ask the guy if that's what they meant.

1

u/Tordek Jan 27 '20

I'm failing to see how you misread my second reply.

1

u/igouy Jan 28 '20

So what did you mean?