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

Optimize buffer usage #191

Merged

Conversation

minecrafter
Copy link
Contributor

This makes the usage of RecyclableMemoryStreams more friendly. This is still not complete (a lot of progress has to be made if serious improvement is to be made).

This implementation prefers GetBuffer() over ToArray() and introduces a new Player method that will compress byte arrays into McpeBatch packets directly. Some places where proper disposal was not used correctly have also been fixed. Support for writing a specific part of a byte array in Package has also been added to permit further optimization.

It's important to note that while this patch makes progress on improving the amount of memory stress in MiNET, many improvements can be had,

@NiclasOlofsson NiclasOlofsson merged commit 91cc2d2 into NiclasOlofsson:master Jul 21, 2016
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.

2 participants