You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/05/09 13:55:46 UTC

[GitHub] [arrow] kiszk commented on a change in pull request #7121: ARROW-8633: [C++] Add ValidateAscii function

kiszk commented on a change in pull request #7121:
URL: https://github.com/apache/arrow/pull/7121#discussion_r422498790



##########
File path: cpp/src/arrow/util/utf8_util_benchmark.cc
##########
@@ -70,16 +70,44 @@ static void BenchmarkUTF8Validation(
   state.SetBytesProcessed(state.iterations() * s.size());
 }
 
+static void BenchmarkASCIIValidation(
+    benchmark::State& state,  // NOLINT non-const reference
+    const std::string& s, bool expected) {
+  auto data = reinterpret_cast<const uint8_t*>(s.data());
+  auto data_size = static_cast<int64_t>(s.size());
+
+  InitializeUTF8();
+#if defined(ARROW_HAVE_NEON) || defined(ARROW_HAVE_SSE4_2)

Review comment:
       How about calling a single function `ValidateAscii` at caller side? Then, the function calls simd or non-simd function based on ifdef. It makes code simple by reducing the number of the repetition `#if defined(ARROW_HAVE_NEON) || defined(ARROW_HAVE_SSE4_2) ...`.
   
   [Here](https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/byte_stream_split.h#L614-L622) is an example.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org