You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/03/08 19:31:39 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3801: Faster timestamp parsing (~70-90% faster)

tustvold commented on code in PR #3801:
URL: https://github.com/apache/arrow-rs/pull/3801#discussion_r1129934411


##########
arrow-cast/src/parse.rs:
##########
@@ -15,11 +15,117 @@
 // specific language governing permissions and limitations
 // under the License.
 
+use arrow_array::timezone::Tz;
 use arrow_array::types::*;
 use arrow_array::ArrowPrimitiveType;
 use arrow_schema::ArrowError;
 use chrono::prelude::*;
 
+/// Helper for parsing timestamps
+struct TimestampParser {
+    digits: [u8; 32],
+    mask: u32,
+}
+
+impl TimestampParser {
+    fn new(bytes: &[u8]) -> Self {
+        let mut digits = [0; 32];
+        let mut mask = 0;
+
+        for (idx, (o, i)) in digits.iter_mut().zip(bytes).enumerate() {

Review Comment:
   Yeah, LLVM does vectorise it automatically, not especially well, but it does sort of



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