C# benchmark beats Go and Rust

3 pointsposted a year ago
by PKop

3 Comments

whytevuhuni

a year ago

The README says it compares matrix multiplication, but it is actually comparing the speed of random number generation libraries.

For every element in the matrix, there are two random number generator invocations, and a single double-precision multiplication. Generating a random number (especially double-precision float) is significantly more complex than just multiplying.

As for the difference, the implementations are vastly different. Rust is known to include more secure-by-default implementations for hashing and random numbers, which may explain why it is slower. Using something like the fastrand crate would help.

whytevuhuni

a year ago

Oh, I see the repo was updated. The new version looks fine as far as I can tell.

user

a year ago

[deleted]