Optimizing JS animation frame engine 2.