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 2022/02/25 10:56:55 UTC

[GitHub] [arrow] bkmgit commented on a change in pull request #12504: ARROW-15763: [C++] Improve CSV writer

bkmgit commented on a change in pull request #12504:
URL: https://github.com/apache/arrow/pull/12504#discussion_r814673288



##########
File path: cpp/src/arrow/csv/writer.cc
##########
@@ -328,6 +359,31 @@ class QuotedColumnPopulator : public ColumnPopulator {
   }
 
  private:
+  // Returns true if there's no quote in the string array
+  // similar to std::find, but with much better performance
+  static bool NoQuoteInArray(const StringArray& array) {
+    const uint8_t* const data = array.raw_data() + array.value_offset(0);
+    const int64_t buffer_size = array.total_values_length();
+    int64_t offset = 0;
+#if defined(ARROW_HAVE_SSE4_2) || defined(ARROW_HAVE_NEON)
+    using simd_batch = xsimd::make_sized_batch_t<uint8_t, 16>;
+    while ((offset + 16) <= buffer_size) {
+      const auto v = simd_batch::load_unaligned(data + offset);

Review comment:
       Maybe it would be better to have a uniform SIMD approach that can be consistently applied throughout the codebase?




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