Skip to content

fix: Replaced HashSet.UnionWith() with loop in NetworkBehaviourUpdate() to avoid heap alloc #3568

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

Merged
merged 4 commits into from
Aug 1, 2025

Conversation

louismclaughlin
Copy link
Contributor

@louismclaughlin louismclaughlin commented Jul 31, 2025

Discovered while profiling a server that had frequent pending dirty network objects to process

Changelog

Fixed: Removed heap alloc in NetworkBehaviourUpdate

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

Backport

Up-ported by #3573

@louismclaughlin louismclaughlin requested a review from a team as a code owner July 31, 2025 04:00
@michalChrobot
Copy link
Collaborator

Quick note that you need to manually add this entry to the CHANGELOG in HERE.

Also this is targeting develop branch meaning NGOv1.X, does this issue also apply to NGOv2.X? If so there will need be a port created to develop-2.0.0 branch (just few notes before Noel/Emma will check out the PR)

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:godmode:

@EmandM EmandM added the port:2.x-needed This issue needs to be ported to 2.X branch label Aug 1, 2025
@EmandM EmandM merged commit d8fabf5 into develop Aug 1, 2025
28 checks passed
@EmandM EmandM deleted the fix/nbu-heap-alloc branch August 1, 2025 18:28
@EmandM EmandM added port:2.x-completed This issue was ported to 2.X branch and removed port:2.x-needed This issue needs to be ported to 2.X branch labels Aug 1, 2025
NoelStephensUnity added a commit that referenced this pull request Aug 5, 2025
…loc (#3573)

Discovered while profiling a server that had frequent pending dirty
network objects to process

## Changelog

Fixed: Removed heap alloc in NetworkBehaviourUpdate

## Testing and Documentation

- No tests have been added.
- No documentation changes or additions were necessary.

## Backport
This is an up-port of #3568

---------

Co-authored-by: Louis McLaughlin <[email protected]>
Co-authored-by: Noel Stephens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port:2.x-completed This issue was ported to 2.X branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants