Check out the source code for performance mods for rimworld called 'rocketman' and 'performance fish'. they use an interesting caching method to preload the game cutting loading times to 25-50%.
In this case I had no choice but to algorithmically make it faster. Each frame simply had to compute this unique data. It was neat to work on because normally you can solve performance issues with caching/ precomputing, etc.
So as not to dox oneself with context, an unrelated example of how a large CPU saving happens is traversing a 3D point cloud as pairs and selecting nearby points. With a flat list it's O(n²) to check each against each other, but an initial pass to build an octree index makes nearby spatial lookup logarithmic (region size doubling/halving), giving O(n log n).
It's even better if there's a distance limit, that drops it to O(n) with a scale factor of the general cloud density.
[ + ] Crackinjokes
[ - ] Crackinjokes 0 points 1 monthApr 1, 2025 19:15:49 ago (+0/-0)
[ + ] CoronaHoax
[ - ] CoronaHoax [op] 0 points 4 weeksApr 2, 2025 10:10:48 ago (+0/-0)
[ + ] ClaytonBigsby313
[ - ] ClaytonBigsby313 0 points 1 monthApr 1, 2025 20:19:07 ago (+0/-0)
[ + ] CoronaHoax
[ - ] CoronaHoax [op] 0 points 1 monthApr 1, 2025 20:50:57 ago (+0/-0)
[ + ] puremadness
[ - ] puremadness 1 point 4 weeksApr 2, 2025 03:14:34 ago (+1/-0)
yay science
[ + ] BulletStopper
[ - ] BulletStopper 1 point 4 weeksApr 2, 2025 12:24:44 ago (+1/-0)*
https://youtu.be/Temc4-G0Fu4?t=23
[ + ] SithEmpire
[ - ] SithEmpire 1 point 4 weeksApr 3, 2025 04:02:21 ago (+1/-0)
So as not to dox oneself with context, an unrelated example of how a large CPU saving happens is traversing a 3D point cloud as pairs and selecting nearby points. With a flat list it's O(n²) to check each against each other, but an initial pass to build an octree index makes nearby spatial lookup logarithmic (region size doubling/halving), giving O(n log n).
It's even better if there's a distance limit, that drops it to O(n) with a scale factor of the general cloud density.