Add a simple rate-limit to requestAnimationFrame to make sure even if tick() gets called multiple times, it'll only ever run once per frame:
function redraw() {
drawPending = false;
// Do drawing ...
}
var drawPending = false;
function requestRedraw() {
if (!drawPending) {
drawPending = true;
requestAnimationFrame(redraw);
}
}
https://developer.mozilla.org/en-US/docs/Games/Techniques/Efficient_animation_for_web_games