Skip to content
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

perf: faster component serialization/deserialization #430

Merged
merged 7 commits into from
Oct 24, 2020

Conversation

Lymdun
Copy link
Member

@Lymdun Lymdun commented Oct 23, 2020

NetworkIdentity DirtyComponentsMask code removed entirely. OnSerialize now includes the component index as byte before serializing each component. Faster because we avoid GetDirtyComponentsMask() and GetSyncModeObserversMask() calculations. Increases allowed NetworkBehaviour components from 64 to 255. Code is significantly more simple. (#2331)

  • perf: NetworkIdentity DirtyComponentsMask code removed entirely. OnSerialize now includes the component index as byte before serializing each component. Faster because we avoid GetDirtyComponentsMask() and GetSyncModeObserversMask() calculations. Increases allowed NetworkBehaviour components from 64 to 255. Bandwidth is now smaller if <8 components, and larger if >8 components. Code is significantly more simple.

  • Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-authored-by: James Frowen jamesfrowendev@gmail.com

Co-authored-by: James Frowen jamesfrowendev@gmail.com

Lymdun and others added 4 commits October 23, 2020 20:21
…rialize now includes the component index as byte before serializing each component. Faster because we avoid GetDirtyComponentsMask() and GetSyncModeObserversMask() calculations. Increases allowed NetworkBehaviour components from 64 to 255. Code is significantly more simple. (#2331)

* perf: NetworkIdentity DirtyComponentsMask code removed entirely. OnSerialize now includes the component index as byte before serializing each component. Faster because we avoid GetDirtyComponentsMask() and GetSyncModeObserversMask() calculations. Increases allowed NetworkBehaviour components from 64 to 255. Bandwidth is now smaller if <8 components, and larger if >8 components. Code is significantly more simple.

* Update Assets/Mirror/Runtime/NetworkIdentity.cs

Co-authored-by: James Frowen <jamesfrowendev@gmail.com>

Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Oct 24, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@paulpach paulpach changed the title perf: NetworkIdentity DirtyComponentsMask code removed entirely. OnSe… perf: faster serialization of components Oct 24, 2020
@paulpach paulpach changed the title perf: faster serialization of components perf: faster component serialization/deserialization Oct 24, 2020
@paulpach paulpach merged commit b675027 into master Oct 24, 2020
@paulpach paulpach deleted the merge_dirtycomp branch October 24, 2020 14:55
github-actions bot pushed a commit that referenced this pull request Oct 24, 2020
## [53.0.1](v53.0.0...v53.0.1) (2020-10-24)

### Performance Improvements

* faster component serialization ([#430](#430)) ([b675027](b675027)), closes [#2331](https://github.com/MirrorNG/MirrorNG/issues/2331)
@github-actions
Copy link
Contributor

🎉 This PR is included in version 53.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants