I optimized requestAnimationFrame calls by prebinding the animation function
0
The normal flow is function animate() { requestAnimationFrame(animate); // do render stuff chicken.position.x++; } animate(); However when you encapsulate your code into a class Normal Animation Step in Class animate() { requestAnimationFrame(this.animate.bind(this)); // do render stuff this.chicken.position.x++; } // somewhere else this.animate.call(this); I noticed you can get a measurable execution speedup by prebinding the animate function to do this Optimized Animation Step animate() { requestAnimationFrame(this.animate_binded); // do render stuff this.chicken.position.x++; } // somewhere else this.animate_binded = this.animate.bind(this); this.animate(); I don't have heap analysis tools but I observed a measurable and repeatble drop i...