High-Frequency Cursor Physics via gsap.quickTo
Investigating performance differences between requestAnimationFrame mouse interpolation vs GSAP quickTo single-tween pipes.
Hypothesis
Standard GSAP to() tweens invoked on every mousemove event cause memory churn and trigger unnecessary tween allocations. Reusing a single gsap.quickTo instance should eliminate garbage collection pauses.
Result
Tested cursor tracking with 10,000 synthetic mouse events. Standard gsap.to created thousands of temporary tween objects per minute. Using gsap.quickTo(target, property, { duration: 0.1 }) created a single long-lived tween that smoothly interpolated high-frequency mouse coordinates with zero layout thrashing.
- gsap.quickTo is significantly more memory-efficient for continuous 60fps tracking than recreating tweens.
- Must always gate custom cursor instantiation with
@media (hover: hover) and (pointer: fine)to avoid breaking mobile touch interactions.