r/programming • • Apr 14 '21

[RFC] Rust support for Linux Kernel

https://lkml.org/lkml/2021/4/14/1023
730 Upvotes

308 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Apr 15 '21

[deleted]

-21

u/7h4tguy Apr 15 '21

I'm not surprised that the Rust n-body benchmark used to be in rust, was 3x slower than C++ and is now entirely unsafe blocks of hand rolled SIMD assembly statements. Rust!

35

u/Boiethios Apr 15 '21

I've verified out of curiosity: that's just false: https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbody.html

Only the#7 is like that, the #2 and #8 are still as fast, and they're idiomatic Rust, without unsafe.

1

u/7h4tguy Apr 25 '21

Must have changed recently - I've been harping on this for years and it was certainly unsafe and mmx not long ago for that bench.

1

u/i-can-sleep-for-days Apr 15 '21

do you have a link to that? Would love to see it.

4

u/ergzay Apr 16 '21

1

u/7h4tguy Apr 25 '21

History, idiot.

2

u/ergzay Apr 25 '21

No idea what you're trying to tell me. If you're saying it used unsafe in the past, then you're contradicting your own post that said "is now entirely", which is still false.

1

u/7h4tguy Apr 26 '21

History is they used 100% rust code and were 3x slower than C++. Then they updated it to use unsafe MMX assembly statements to get comparable benchmarks.

Looks like they finally cleaned up their optimizer the the latest version.

2

u/ergzay Apr 26 '21

Yes but we weren't talking about history...

Even then, I don't know of any massive improvements in the optimizer that would cause that.

If we look in the wayback machine back to at least beginning of 2019, what you're saying is still not true.

http://web.archive.org/web/20190130192322/https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/nbody.html

The ratio between C++ and early Rust versions of the code is the same then as it is now. There's just been better Rust versions written since then (including ones with unsafe, and ones without).

1

u/7h4tguy Apr 29 '21

You're just taking random points in time. I've been following Rust for a while and was hesitant at first because of the benchmark game. They did exactly what I said and I'm not going to spend half a day trawling site history to show the comedy.

2

u/ergzay Apr 29 '21

You're just taking random points in time.

No... I'm talking about going back to the oldest record available on web archive. It's you who's talking about random points in time. At no point in the past as far as I can tell is what you are saying EVER been true.

→ More replies (0)