Skip to content

Conversation

EmandM
Copy link
Collaborator

@EmandM EmandM commented Sep 19, 2025

Purpose of this PR

Optimize property accessors around NetworkVariable

  1. Keep a self reference to m_NetworkBehaviour, m_NetworkObject and m_NetworkManager
  2. Swap CanWrite and CannotWrite to aggressively inlined functions
  3. Store a m_UseServerTime boolean that can be calculated once rather than on every check on the NetworkVar
  4. Add early returns in the NetowrkVariableDeltaMessage to reduce indentation and increase readability.

Jira ticket

Needs a JIRA ticket

Changelog

  • Changed: Improved performance of NetworkVariable property accessors.

Documentation

  • No documentation changes or additions were necessary.

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

These changes are less risky and should be covered by the automated testing.

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.

Backports

This is a performance improvement so backporting this fix isn't necessary.

@EmandM EmandM requested a review from a team as a code owner September 19, 2025 17:26
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.

1 participant