com.unity.formats.alembic icon indicating copy to clipboard operation
com.unity.formats.alembic copied to clipboard

Improve CPU performance

Open smitdylan2001 opened this issue 3 years ago • 8 comments

Improved CPU performance with:

  • Merge .position +.rotation to .SetPositionAndRotation
  • Use TryGetComponent for improved garbage allocations
  • Simplify string comparisons

smitdylan2001 avatar Oct 10 '22 12:10 smitdylan2001

CLA assistant check
All committers have signed the CLA.

unity-cla-assistant avatar Oct 10 '22 12:10 unity-cla-assistant

Any chance on getting merged?

smitdylan2001 avatar Dec 04 '22 22:12 smitdylan2001

Hi @smitdylan2001, sorry for the late reply, there is a chance to be merged yes but we would need a bit more info on the actual gain of your changes.

Could you please share:

  • What was your setup to compare performances? Did you tried on different asset size, etc?
  • Can you share the before/after (maybe screenshot of the Performance editor in Unity) and highlight the performance gain (maybe in different scenario if it changes)?

Thanks!!

lucillecaillaud avatar Dec 15 '22 17:12 lucillecaillaud

Hi @smitdylan2001, sorry for the late reply, there is a chance to be merged yes but we would need a bit more info on the actual gain of your changes.

Could you please share:

  • What was your setup to compare performances? Did you tried on different asset size, etc?
  • Can you share the before/after (maybe screenshot of the Performance editor in Unity) and highlight the performance gain (maybe in different scenario if it changes)?

Thanks!!

It's not much noticeable at runtime, and I can only benchmark in a few weeks. I do think that every bit can help with performance, especially if it doesn't change any behaviour

Here are some of the changes benchmarked: https://forum.unity.com/threads/performance-tips.1336262/ The differences between changes can be 50+% for the same line

smitdylan2001 avatar Dec 15 '22 17:12 smitdylan2001

If it helps similar changes are made on other Unity repos, like netcode for GO, render pipelines, probuilder and more

smitdylan2001 avatar Dec 26 '22 16:12 smitdylan2001

Here's some more info: https://github.com/Unity-Technologies/InputSystem/pull/1578

smitdylan2001 avatar Mar 14 '23 09:03 smitdylan2001

@lucillecaillaud any update on a merge?

smitdylan2001 avatar Apr 10 '23 09:04 smitdylan2001

Any updates? Would be nice to have this added

smitdylan2001 avatar May 20 '24 10:05 smitdylan2001