Help make my ideal gas simulation ideally fast

You could store 1/r2.
Maybe use gflop.jl to see how fast you already are