Optimize JS in HTML5 game using Performance Tools