-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Investigate leveraging ArrayPool #6710
Comments
Although we can replace |
Using We would more leverage from using reusable |
I have not identified other places where using ArrayPool would bring measurable performance benefit. |
@rokonec thank you, what you wrote makes perfect sense. Is it possible to quantify the impact of building a reusable |
@ladipro I was mislead by Sorry for this mistake. |
We are introducing ArrayPool in #6705.
By quick analyze I have identified following areas which might leverage from buffers pool.
InterningBinaryReader._buffer
- Since _buffer is used only inReadString
we can simplify code, delete _buffer and its initialization from call stacks and justRent\Return
buffer of destination string size in theReadString
method.BinaryReader.ReadBytes
and relatedTranslate(ref byte[] byteArray)
- good candidate isTargetResult.TranslateItems
RecyclableMemoryStream
(or some equivalent usingArrayPool.Shared
) in places where our current usage ofMemoryStream
is allocating a lot.The text was updated successfully, but these errors were encountered: