You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/10/19 16:59:27 UTC
[I] [C++] What's the difference between `arrow::internal::BitWriter` and `arrow::internal::FirstTimeBitWriter` [arrow]
mapleFU opened a new issue, #38355:
URL: https://github.com/apache/arrow/issues/38355
### Describe the usage question you have. Please include as many useful details as possible.
I've find `arrow::internal::BitWriter` and `arrow::internal::FirstTimeBitWriter` in our repo. The `arrow::internal::FirstTimeBitWriter` has some descriptions:
```
// Like BitmapWriter, but any bit values *following* the bits written
// might be clobbered. It is hence faster than BitmapWriter, and can
// also avoid false positives with Valgrind.
```
But actually I didn't know what it actually means. When should I use `FirstTimeBitWriter` and when should I use `BitWriter`? Is there any materialize for this?
### Component(s)
C++
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [C++] What's the difference between `arrow::internal::BitWriter` and `arrow::internal::FirstTimeBitWriter` [arrow]
Posted by "felipecrv (via GitHub)" <gi...@apache.org>.
felipecrv commented on issue #38355:
URL: https://github.com/apache/arrow/issues/38355#issuecomment-1775872901
When writing to a bitmap, the CPU can't write only the bits requested, the smallest unit of write is the byte but an entire 64-bit word is more friendly to the micro arch. The way more granularity is achieved (semantically) is by reading the bitmap and crafting a word that contains the existing bits and the new bits (when the bits being written don't align to the 64-bit boundaries).
The `FirstTimeBitmapWriter` will not care about the bits on the tail of the word being written which allows it to write to the bitmap with less operations. It only needs to preserve the bits that antecede the bits being written, no need to read the bits that follow it on the bitmap memory into the word being written.
It's faster when you know your next iteration is going to be over-writing the following bits.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [C++] What's the difference between `arrow::internal::BitWriter` and `arrow::internal::FirstTimeBitWriter` [arrow]
Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU closed issue #38355: [C++] What's the difference between `arrow::internal::BitWriter` and `arrow::internal::FirstTimeBitWriter`
URL: https://github.com/apache/arrow/issues/38355
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [C++] What's the difference between `arrow::internal::BitWriter` and `arrow::internal::FirstTimeBitWriter` [arrow]
Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on issue #38355:
URL: https://github.com/apache/arrow/issues/38355#issuecomment-1777088532
Get it, thanks @felipecrv !
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org