wgtmac commented on code in PR #49960:
URL: https://github.com/apache/arrow/pull/49960#discussion_r3224845392


##########
cpp/src/arrow/util/byte_stream_split_internal.h:
##########
@@ -421,14 +421,28 @@ void ByteStreamSplitEncodeScalar(const uint8_t* 
raw_values, int width,
   DoSplitStreams(raw_values, kNumStreams, num_values, dest_streams.data());
 }
 
+// If changing this value, please check that TestByteStreamSplitLargeWidth 
still
+// exercises the slow path.
+constexpr inline int kByteStreamSplitMaxTemporaryAlloc = 8192;
+
 inline void ByteStreamSplitEncodeScalarDynamic(const uint8_t* raw_values, int 
width,
                                                const int64_t num_values, 
uint8_t* out) {
-  ::arrow::internal::SmallVector<uint8_t*, 16> dest_streams;
-  dest_streams.resize(width);
-  for (int stream = 0; stream < width; ++stream) {
-    dest_streams[stream] = &out[stream * num_values];
+  if (ARROW_PREDICT_TRUE(width < kByteStreamSplitMaxTemporaryAlloc / 8)) {
+    ::arrow::internal::SmallVector<uint8_t*, 32> dest_streams;

Review Comment:
   Why the small vector size is changed to 32 here but 
ByteStreamSplitDecodeScalarDynamic still uses 16? 



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