Reduce for loop function call overhead
Closed this issue · 1 comments
YiranXu commented
In "nbody" function, the inner for loop "for _ in range(iterations): advance(0.01, BODIES, key_pairs)" can be moved into "advanced" function by calling "for _ in range(iterations)" at the beginning of the "advance" function and pass "iterations" as an argument for the "advance" function.
nyuxz commented
Thanks, improve a lot.