zeroshade commented on PR #13277:
URL: https://github.com/apache/arrow/pull/13277#issuecomment-1150003718

   @mdepero Unfortunately, like many languages, a `bool` in Go is represented 
with a full byte (just like C++, and others). So `make([]bool, n)` allocates n 
bytes. Basically the entire issue boils down to the fact that that Arrow's 
`BytesRequired` for boolean traits returns `ceiling(n/8)` bytes.
   
   That said, I do like this approach better than the previous approach since 
we're not ignoring the allocated scratch space and is a much smaller change. As 
a future refactor I can improve this to remove the need for the if and convert 
the scratch buffer to use a pool of buffers to reduce allocations but this is 
good for now assuming it fixes your issue in testing. I particularly like that 
you added the TODO comment. Ideally you'd create a corresponding JIRA card and 
then reference it in the TODO.


-- 
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]

Reply via email to