Skip to content

Optimize AnimationUtils#44

Open
jverral wants to merge 1 commit intoUnity-Technologies:mainfrom
jverral:user/joverral/animationUtil_opts
Open

Optimize AnimationUtils#44
jverral wants to merge 1 commit intoUnity-Technologies:mainfrom
jverral:user/joverral/animationUtil_opts

Conversation

@jverral
Copy link
Copy Markdown

@jverral jverral commented Mar 26, 2026

AddKey is slow, as it does a sort every time. It is much faster to use the newer SetKeys method and pass in a Span of the array of keys we're using from a shared Array pool. In addition, we're seeing some GLTF models with hundreds of curves, so paying for string reformatting 900 times seems unnecessary.
Before:
image

After:
image

@cla-assistant-unity
Copy link
Copy Markdown

cla-assistant-unity bot commented Mar 26, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant