Optimize Animation Resource, Library, Mixer, and Player#116394
Conversation
314c454 to
616d900
Compare
616d900 to
b61605b
Compare
There was a problem hiding this comment.
This PR doesn't work correctly. This seems to break #110474 (review) AnimationTree example.
Also, there is a potential conflict in EditorFolding::_fill_folds() by #113479, so please rebase to the latest master.
b6efcab to
d744748
Compare
TokageItLab
left a comment
There was a problem hiding this comment.
I believe it works now. However, it seems to include implementations unrelated to optimization, so those should be removed from this PR.
e4f3e62 to
932c230
Compare
f07fcc0 to
2f5018c
Compare
TokageItLab
left a comment
There was a problem hiding this comment.
CI is throwing a network error, but I believe the current code is fine (I'll re-run it later). I'll double-check it at the Animation Meeting this weekend just to be sure.
Co-Authored-By: Silc Lizard (Tokage) Renew <tokage.it.lab@gmail.com>
|
Referencing the performance numbers in the original PR: @Ryan-000 We would like to consider adding the benchmark from that comment to be added to the Godot benchmarks repository. Are the animations in this optimize project licensed such that they can be added to godot benchmarks?
|
lyuma
left a comment
There was a problem hiding this comment.
Approved in meeting.
We discussed that the track cache improvements in #117030 can be done after this is merged.
I'm happy with the benchmark. The benchmark is pretty comprehensive for the BlendTree, but we noticed there was no benchmark for the animation state machine. There may be more optimizations needed there, for example with state transitions.
I'm also wondering if there might be some advantage in caching the animation list. Even with the new get_animation_list function, it is making a copy of the list each time.
The character and animations are from Mixamo, so I am not sure whether they can be redistributed publicly. So you may need to replace them with your own. One note: the animation tree is a stripped-down version from one of my projects (private animation references were replaced by a T-pose). Because of that, many of the nodes are effectively placeholders and do not currently contribute meaningful behaviour. I wanted to mention that in case it matters for benchmark use. |
|
@Ryan-000 Could you add benchmark numbers for this PR to the OP? Interested users will likely land here after it's merged from the next dev snapshot's release notes, and currently the description doesn't really tell them what to expect. |
|
Thanks! |
Supersedes #113442
Related #112308 #110474
@TokageItLab I will rebase #113444 once this makes it in
Benchmark
Compiled with
scons production=yes debug_symbols=yes target=editorRan with
./engine_binary --headless --print-fps --path /path/to/project res://path_to_world.tscnProject: optimize.zip
Scene:
res://World.tscnBefore: (220b0b2)
FPS: high 197, low 190, median 195
MSPF: high 5.26, low 5.07, median 5.12
After: (73d041d)
FPS: high 225, low 219, median 222.5
MSPF: high 4.56, low 4.44, median 4.49
median FPS change: +27.5 (+14.10%)
median MSPF change: -0.63 (-12.30%)
Scene:
res://World_StressTest.tscnBefore (220b0b2)
FPS: high 99, low 93, median 97
MSPF: high 10.75, low 10.10, median 10.30
After: (73d041d)
FPS: high 104, low 101, median 103
MSPF: high 9.90, low 9.61, median 9.70
median FPS change: +6 (+6.19%)
median MSPF change: -0.60 (-5.83%)