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

Presize MemoryStream when possible. #14529

Merged
merged 1 commit into from Dec 18, 2017

Conversation

Projects
None yet
3 participants
@RoosterDragon
Member

RoosterDragon commented Dec 16, 2017

Also use GetBuffer when we know we have presized the stream to the exact required size to prevent a needless copy.

Helps with #14178 by reducing allocations during loading (the main culprits are ZipFile and MixFile), decreasing the peak memory reached when loading. The other stuff is mostly just along for the ride. :)

Show outdated Hide outdated OpenRA.Game/Network/Order.cs Outdated

@pchote pchote added this to the Next release milestone Dec 16, 2017

Presize MemoryStream when possible.
Also use GetBuffer when we know we have presized the stream to the exact required size to prevent a needless copy.
@pchote

pchote approved these changes Dec 18, 2017

@pchote pchote added the PR: Needs +2 label Dec 18, 2017

@abcdefg30 abcdefg30 merged commit ca01a1f into OpenRA:bleed Dec 18, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@abcdefg30

This comment has been minimized.

Show comment
Hide comment
@abcdefg30
Member

abcdefg30 commented Dec 18, 2017

@RoosterDragon RoosterDragon deleted the RoosterDragon:memory-stream-presize branch Dec 19, 2017

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