4 ms·
No, there is something wrong with the Rust version. I added println!("{:?}",x); to the end, and now I get 134 second runtime. Also the output is [[NaN, NaN, Na
by CJefferson 10y ago
No, there is something wrong with the Rust version. I added println!("{:?}",x); to the end, and now I get 134 second runtime.
Also the output is [[NaN, NaN, NaN], [NaN, NaN, NaN]], which is a bit worrying...
- one-more-minute 10y agoAll the particles in the simulation start at (0, 0, 0) so gravity is infinite, and the whole computation is operating on `NaN`s. Not sure how much this affects the benchmark, but it'd probably be smart to randomise the starting positions.
- fhars 10y agoSince the masses are also zero, the gravity is actually NaN.
- FeepingCreature 10y agoOperating on NaN is hugely slower than normal floating point numbers. You're hitting a slowpath in the processor's floating point logic.
- marblestation 10y agoThat is fixed now, conclusions are still valid :-) Thanks!