Optimizing a think hook over many props
⚡ Performance•Updated 2 days ago•0 views
Cache math functions as locals (local sin = math.sin skips a table lookup), store physics objects instead of entities, hoist invariant values (positions) out of…
How to optimize a per-tick think hook handling dozens of physics props
Cache math functions as locals (local sin = math.sin skips a table lookup), store physics objects instead of entities, hoist invariant values (positions) out of the loop, and update at lower intervals (e.g. every N ms) instead of every tick.