News for hackers. Stuff that matters.
Re:Rust is now overall faster than C in benchmarks by creato on Monday January 04, 2021 @10:17PM (#25641650)
It also looks like this version is using an algorithm that none of the others use: it precomputes the distance pairs for all bodies. Some of the others precompute the vectors between the pairs, but that's not the expensive part of computing the distance.

As an aside: this made me notice this n-body simulation only has 5 bodies! This is a pretty strange case that makes these O(n^2) optimizations practical. The n-body simulations I've been familiar with in the past had thousands of bodies, where this approach probably isn't a good idea.

There are no comments on this comment yet.