pitrou commented on code in PR #50483:
URL: https://github.com/apache/arrow/pull/50483#discussion_r3630157897


##########
cpp/src/arrow/csv/lexing_internal.h:
##########
@@ -138,6 +144,13 @@ class SSE42Filter {
                         _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY);
   }
 
+  // _mm_cmpistrc is an implicit-length compare: it treats a NUL byte as a
+  // terminator and can miss a real delimiter/quote/newline sharing an 8-byte
+  // word with one. Never use this filter on a block that contains a NUL.

Review Comment:
   Let's explain why we don't use the explicit-length compare instruction
   ```suggestion
     // _mm_cmpistrc is an implicit-length compare: it treats a NUL byte as a
     // terminator and can miss a real delimiter/quote/newline sharing an 8-byte
     // word with one. Never use this filter on a block that contains a NUL.
     // We could instead use the explicit-length compare _mm_cmpestrc but
     // it comes with a massive performance cost on some CPUs
     // (some benchmarks were measured to be twice slower in
     // https://github.com/apache/arrow/pull/50483).
   ```



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