ngAnimate 1.2.0-rc2 has performance impact #4011
Description
Just by including the ngAnimate
module in my project (using latest code on master), I am seeing noticeable performance degradation that is especially visible on devices with slower processors like the iPod Touch 4g.
In my case an ngRepeat
with around 50-100 items and no CSS transitions / animations takes what could be 2-3x longer to render on a mobile device with ngAnimate
. I noticed that the performAnimation
function is being called 50-100 times per digest (the number goes up or down depending on the number of items in the ngRepeat
).
The animation code is being executed on all elements of directives that support animation whether or not there are actually CSS transitions / animations that apply to those elements, and it has a performance impact. For most animation-enabled directives it might not be a big deal but it is especially noticeable during the rendering and re-rending of items in an ngRepeat
.