If you use 'requestAnimationFrame()' instead of a 'setInterval()' for triggering your update method, your animation will perform a lot smoother:
https://developer.mozilla.org/en-US/docs/Web/API/window/requ...
Re:Show HN: Boids Simulation
by anoop-elias on Tuesday March 31, 2015 @04:33PM
(#9299686)
Have a look at this one, highly recommended, https://github.com/hughsk/ticker
Source: https://github.com/tech-no-crat/boids