Skip to content

fix: Message sending GC allocations - #4119

Open
EmandM wants to merge 6 commits into
develop-2.0.0from
fix/gc-allocs
Open

fix: Message sending GC allocations#4119
EmandM wants to merge 6 commits into
develop-2.0.0from
fix/gc-allocs

Conversation

@EmandM

@EmandM EmandM commented Aug 7, 2026

Copy link
Copy Markdown
Member

Purpose of this PR

Fixes some GC allocations in message hot paths.

Jira ticket

fixes: #4091

Changelog

  • Fixed: Resolved GC allocations in some hot paths

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

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?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Up-port

Up-port needed

Backports

n/a

@EmandM
EmandM requested a review from a team as a code owner August 7, 2026 16:35
@codecov-github-com

codecov-github-com Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...eobjects/Runtime/Messaging/Messages/RpcMessages.cs 0.00% 2 Missing ⚠️
@@                Coverage Diff                @@
##           develop-2.0.0    #4119      +/-   ##
=================================================
+ Coverage          73.93%   73.94%   +0.01%     
=================================================
  Files                172      172              
  Lines              28095    28099       +4     
=================================================
+ Hits               20771    20779       +8     
+ Misses              7324     7320       -4     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu_pinnedTrunk 73.65% <93.33%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../Messaging/Messages/NetworkVariableDeltaMessage.cs 77.92% <100.00%> (ø)
...objects/Runtime/Messaging/NetworkMessageManager.cs 82.39% <100.00%> (ø)
...netcode.gameobjects/Runtime/Metrics/MetricHooks.cs 100.00% <100.00%> (ø)
...Runtime/NetworkVariable/Collections/NetworkList.cs 79.75% <100.00%> (-0.07%) ⬇️
...ode.gameobjects/Runtime/Serialization/BitReader.cs 94.23% <100.00%> (ø)
...eobjects/Runtime/Serialization/FastBufferReader.cs 80.03% <100.00%> (ø)
...eobjects/Runtime/Messaging/Messages/RpcMessages.cs 42.61% <0.00%> (+0.94%) ⬆️
Components Coverage Δ
com.unity.netcode.gameobjects 73.94% <93.33%> (+0.01%) ⬆️

ℹ️ Need help interpreting these results?

@NoelStephensUnity NoelStephensUnity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!
👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lot of GC when receive and send messages

3 participants