-
Notifications
You must be signed in to change notification settings - Fork 460
fix: Removed unnecessary GC Allocation #3527
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
fix: Removed unnecessary GC Allocation #3527
Conversation
|
Do you know if this is only 2.X specific or should also be backported to 1.X ( |
Portions of this PR could be back ported to v1.x. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samlucas-unity Looks good and thank you for the fix! Sorry for the delay on getting this back ported.
Fix for [MTTB-85](https://jira.unity3d.com/browse/MTTB-85) removed the use of a foreach causing an unnecessary GC Allocation. Did a full sweep of internal `NetworkManager.ConnectedClientsIds` and replaced with either `for` loop or directly referencing the `NetworkConnectionManager.ConnectedClientIds`. ## Changelog - Fixed: Issue with unnecessary internal GC Allocations when using the `IReadOnlyList` `NetworkManager.ConnectedClientsIds` within a `foreach` statement by either replacing with a `for` loop or directly referencing the `NetworkConnectionManager.ConnectedClientIds`. ## Documentation - No documentation updates were required. ## Testing & QA [//]: # ( This section is REQUIRED and should describe how the changes were tested and how should they be tested when Playtesting for the release. It can range from "edge case covered by unit tests" to "manual testing required and new sample was added". Expectation is that PR creator does some manual testing and provides a summary of it here.) ### Functional Testing [//]: # (If checked, List manual tests that have been performed.) _Manual testing :_ - [X] `Manual testing done` - Tested manually before and after fix to confirm the allocation was present and then absent. _Automated tests:_ - [ ] `Covered by existing automated tests` - [ ] `Covered by new automated tests` _Does the change require QA team to:_ - [ ] `Review automated tests`? - [ ] `Execute manual tests`? If any boxes above are checked, please add QA as a PR reviewer. ## Backport This is the backport for #3527
Fix for MTTB-85 removed the use of a foreach causing an unnecessary GC Allocation.
Did a full sweep of internal
NetworkManager.ConnectedClientsIdsand replaced with eitherforloop or directly referencing theNetworkConnectionManager.ConnectedClientIds.Changelog
IReadOnlyListNetworkManager.ConnectedClientsIdswithin aforeachstatement by either replacing with aforloop or directly referencing theNetworkConnectionManager.ConnectedClientIds.Documentation
Testing & QA
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?If any boxes above are checked, please add QA as a PR reviewer.
Backport
The backport of this PR is #3601