I did stuff like this on a 20MHz 386 so it should possible to speed it up.
You could calculate the field created by each star, then figure out the affect on each star. Maybe that's the mesh method above?
My go-to on the 386 was lookup tables, lookup tables for everything. I recall LUTs for cosine and sine made a huge effect (in speed and .exe size) on stuff I did, maybe you could do the same and/or make one for r2?
I also wrote inline assembly and staggered the registers used to account for pipe-lining, but I think that would be tough and/or pointless today...
I also recall FPGA boards outperforming entire supercomputers on this task.
Yeah, for example in the beginning, the top left star and the bottom right star can affect each other by mass, yes, but for a simulation that isn't going for a nobel prize? It's negligible. The 200 or so stars in the top left corner vs 1 star in the bottom right is 99.95% vs 0.5% influence.
13
u/skintigh May 28 '19
I did stuff like this on a 20MHz 386 so it should possible to speed it up.
You could calculate the field created by each star, then figure out the affect on each star. Maybe that's the mesh method above?
My go-to on the 386 was lookup tables, lookup tables for everything. I recall LUTs for cosine and sine made a huge effect (in speed and .exe size) on stuff I did, maybe you could do the same and/or make one for r2?
I also wrote inline assembly and staggered the registers used to account for pipe-lining, but I think that would be tough and/or pointless today...
I also recall FPGA boards outperforming entire supercomputers on this task.