VRC-Gesture-Manager icon indicating copy to clipboard operation
VRC-Gesture-Manager copied to clipboard

Profiling Animators.Update doesn't tell the full story

Open jellejurre opened this issue 1 year ago • 1 comments

Hi BlackStartX,

I commented this on #17 , but I thought i'd move it to its own issue for easier tracking.

It's really nice to see animator performance gaining more attention, and your tool will certainly aid with that, so I'm really happy to see this implemented, however, please note that Animator.Update isn't the only place where animator performance increases.

In my testing I noticed that adding AnimatorControllerPlayable.PrepareFrame and Animators.Update give you quite accurate representations.

image

Above you can see the performance of a scene with 920 layers with 2 state toggles and nothing else, and you can see that AnimatorControllerPlayable.PrepareFrame also takes up quite some time, as an example. This would be missed by using just Animator.Update

jellejurre avatar Jul 13 '23 23:07 jellejurre

Hi jellejurre~ ^-^ 🌺

Uhh, I see that's indeed a big chunk of time~

I was planning to improve the feature in future releases and I'm glad to receive feedback even before it's been officially released! (Also, thanks for the kind words~ ♥)

I may list the AnimatorControllerPlayable.PrepareFrame event above the Animator.Update event, so it's listed based on the order of events (?)

By the way, I'm currently away from my house so I can't develop nor testing any changes, but I'll definetly work on it once I'm back! ^-^

Thanks again for the feedback,

  • BlackStartx

BlackStartx avatar Jul 14 '23 20:07 BlackStartx

Hi jellejurre~

A PR (#58) fixed this by including the 3 PlayerLoop calls:

  • Update.DirectorUpdate
  • PreLateUpdate.DirectorUpdateAnimationBegin
  • PreLateUpdate.DirectorUpdateAnimationEnd

Those should wrap around all animator activity in the scene way better than it was before.

Being AnimatorControllerPlayable.PrepareFrame a sub-call of PreLateUpdate.DirectorUpdateAnimationBegin it's time will be included in the profiled result~ :3

I'll close the issue since the PR got merged, thanks once again! :3

  • BlackStartx

BlackStartx avatar Jul 15 '24 16:07 BlackStartx