Gltf loader: do not clone animation keys

In glTFLoaderAnimation, animation is constructed with setKeys()

And setKeys defaults to clone keys

Since these keys are built in-place for each channel (should be for each sampler, since gltf samplers can be reused, and we can discuss it later), keys should not be cloned, to reduce gc pressure

3 Likes

cc @bghgary and @alexchuber but I guess a PR would be welcomed :slight_smile:

Seems reasonable. I don’t know how to test this though. How do we ensure this doesn’t break anything?

Well, by static analysis. keys are created in callback in _loadAnimationChannelFromTargetInfoAsync, and passed to propertyInfo.buildAnimations, and never escaped from the scope.

Ahh, sorry, I misunderstand what was happening, read the code too fast :slight_smile: Yes, this seems good. Did you want to create a PR?

1 Like

Yeah, here it is:

1 Like

It is merged. Thanks for your contribution!