zeroshade commented on code in PR #715:
URL: https://github.com/apache/arrow-go/pull/715#discussion_r2954537372


##########
parquet/metadata/bloom_filter.go:
##########
@@ -134,6 +134,64 @@ func GetSpacedHashes[T parquet.ColumnTypes](h Hasher, 
numValid int64, vals []T,
        return out
 }
 
+// GetHashesFromBitmap computes hashes for boolean values directly from a 
bitmap
+// without converting to []bool, avoiding 8x memory overhead.
+func GetHashesFromBitmap(h Hasher, bitmap []byte, bitmapOffset int64, 
numValues int64) []uint64 {
+       if numValues == 0 {
+               return []uint64{}
+       }
+
+       // Convert each bool bit to []byte for hashing
+       // Reuse a single-byte slice to avoid allocating per value
+       out := make([]uint64, numValues)
+       b := []byte{0}
+       for i := int64(0); i < numValues; i++ {

Review Comment:
   good point, looks like the go fix is gonna be a big change honestly so I'll 
hold off on that for the moment and just fix this one spot for this PR



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