zhouyan commented on PR #41638:
URL: https://github.com/apache/arrow/pull/41638#issuecomment-2112136670
Tested with my applications, the regressions looks to be fixed.On 15 May
2024, at 00:27, Matt Topol ***@***.***> wrote:
@zeroshade commented on this pull request.
In go/parquet/internal/encoding/types.go:
> @@ -185,7 +185,7 @@ func (b *PooledBufferWriter) Reserve(nbytes int) {
b.buf = bufferPool.Get().(*memory.Buffer)
}
- newCap := utils.Max(b.buf.Cap()+b.offset, 256)
+ newCap := utils.Max(b.buf.Cap(), 256)
It's not "256 more bytes", it's giving a minimum. If you have a buffer which
currently has less than 256 bytes as its capacity, we push its capacity to 256
in order to reduce future reallocations (since this is a buffer pool and we'll
eventually reuse the buffer).
If this becomes an issue for anyone we can definitely make this configurable
or reduce it. but it does go a long way to reduce small allocations if you're
writing small row groups
—Reply to this email directly, view it on GitHub, or unsubscribe.You are
receiving this because you were mentioned.Message ID: ***@***.***>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]