fix serious performance problem.
fix.
fix.
fix.
fix compile error.
use auto&.
Merge pull request #9567 from joewan/v3-improve-perf

fix serious performance problem of Animate.