3 ms·
What is the point of `algorithms::bubbleSort`?
by csjh 3y ago
What is the point of `algorithms::bubbleSort`?
- greysphere 3y agoLast I checked bubble sort was the fastest sort for small counts of small objects. That was 10 years ago though so thing might have changed potentially something that might take better advantage of vector ops. It's also often the correct choice for something like a collision partition for a physics sim where elements are most likely in the same sort position each frame.
- usefulcat 3y agoAround half as much code is generated for bubble sort compared to std::sort, e.g.: https://godbolt.org/z/KbaTeno3j https://godbolt.org/z/KbaTeno3j