Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CPU performance #515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smitdylan2001
Copy link

Improved CPU performance with:

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

Improved CPU performance with:
- Merge .position +.rotation to .SetPositionAndRotation
- Use TryGetComponent for improved garbage allocations
- Simplify string comparisons
@unity-cla-assistant
Copy link

unity-cla-assistant commented Oct 10, 2022

CLA assistant check
All committers have signed the CLA.

@smitdylan2001
Copy link
Author

Any chance on getting merged?

@lucillecaillaud
Copy link

lucillecaillaud commented Dec 15, 2022

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!!

@smitdylan2001
Copy link
Author

smitdylan2001 commented Dec 15, 2022

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
Copy link
Author

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

@smitdylan2001
Copy link
Author

Here's some more info:
Unity-Technologies/InputSystem#1578

@smitdylan2001
Copy link
Author

@lucillecaillaud any update on a merge?

@smitdylan2001
Copy link
Author

Any updates?
Would be nice to have this added

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

Successfully merging this pull request may close these issues.

3 participants