Skip to content

Performance Improvement#2176

Closed
smitdylan2001 wants to merge 3 commits intoUnity-Technologies:developfrom
smitdylan2001:perf/PerformanceImprovements
Closed

Performance Improvement#2176
smitdylan2001 wants to merge 3 commits intoUnity-Technologies:developfrom
smitdylan2001:perf/PerformanceImprovements

Conversation

@smitdylan2001
Copy link
Copy Markdown
Contributor

  • Merge if else into return
  • Merge .rotation and .position into .SetPositionAndRotation
  • Remove .ToString() call on strings
  • Use TryGetComponent to reduce garbage allocation
  • Merge .Where().Count() calls into .Count() call
  • Remove indirect gameObject call
  • Remove redundant null check
  • Use native .Count instead of LINQ method
  • Use faster string comparison

Changelog

  • Fixed: Improved performance

Testing and Documentation

No functionality changed

- Merge if else into return
- Merge .rotation and .position into .SetPositionAndRotation
- Remove .ToString() call on strings
- Use TryGetComponent to reduce garbage allocation
- Merge .Where().Count() calls into .Count() call
- Remove indirect gameObject call 
- Remove redundant null check
- Use native .Count instead of LINQ method
- Use faster string comparison
@smitdylan2001 smitdylan2001 requested review from a team as code owners September 1, 2022 12:41
@unity-cla-assistant
Copy link
Copy Markdown

unity-cla-assistant commented Sep 1, 2022

CLA assistant check
All committers have signed the CLA.

@0xFA11
Copy link
Copy Markdown
Contributor

0xFA11 commented Sep 1, 2022

thank you for the PR!

I think we could review and get these minor improvements — perhaps we should consider putting that into the sprint? @JesseOlmer

@gkaragoz
Copy link
Copy Markdown

gkaragoz commented Sep 7, 2022

These are nice small details that affects impacts of performance improvements, especially GC one. Is it going to be approved?

@0xFA11 0xFA11 added the good-first-issue Contributions are welcome. Good first issue for newcomers or first time contributors. label Sep 7, 2022
@0xFA11
Copy link
Copy Markdown
Contributor

0xFA11 commented Sep 7, 2022

so here's an update: I had a quick chat with the team. there are a few updates we're making around the same area atm — we think we'll get back to this after merging those other changes and merging develop branch back into this PR after them. so, stay tuned :)

Comment thread com.unity.netcode.gameobjects/Components/NetworkTransform.cs
@JesseOlmer
Copy link
Copy Markdown
Contributor

Tracked internally with MTT-4641.
@smitdylan2001 if you could update the branch with the latest from develop we can have someone take a look at the PR in the next day or two.

@jeffreyrainy
Copy link
Copy Markdown
Contributor

Thank you for the submission!

I'll be using #2204 to check that it passes our CI and will review there.

@smitdylan2001
Copy link
Copy Markdown
Contributor Author

smitdylan2001 commented Sep 15, 2022

Tracked internally with MTT-4641. @smitdylan2001 if you could update the branch with the latest from develop we can have someone take a look at the PR in the next day or two.

Should be up to date with the latest master

@jeffreyrainy
Copy link
Copy Markdown
Contributor

jeffreyrainy commented Sep 23, 2022

Merged as #2204 (pending CI)

Thanks for the improvements!

jeffreyrainy added a commit that referenced this pull request Sep 23, 2022
* Performance Improvement

- Merge if else into return
- Merge .rotation and .position into .SetPositionAndRotation
- Remove .ToString() call on strings
- Use TryGetComponent to reduce garbage allocation
- Merge .Where().Count() calls into .Count() call
- Remove indirect gameObject call 
- Remove redundant null check
- Use native .Count instead of LINQ method
- Use faster string comparison

* style: adjusting to code standards

Co-authored-by: smitdylan2001 <dylan.smit01@gmail.com>
jakobbbb pushed a commit to GooseGirlGames/com.unity.netcode.gameobjects that referenced this pull request Feb 22, 2023
…y-Technologies#2204)

* Performance Improvement

- Merge if else into return
- Merge .rotation and .position into .SetPositionAndRotation
- Remove .ToString() call on strings
- Use TryGetComponent to reduce garbage allocation
- Merge .Where().Count() calls into .Count() call
- Remove indirect gameObject call 
- Remove redundant null check
- Use native .Count instead of LINQ method
- Use faster string comparison

* style: adjusting to code standards

Co-authored-by: smitdylan2001 <dylan.smit01@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good-first-issue Contributions are welcome. Good first issue for newcomers or first time contributors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants