From ef5e05d876cdf90481a133f1d5d91d4e4b596adc Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 14 Feb 2024 10:26:02 -0800 Subject: [PATCH] Use atoi_simd --- arrow-cast/Cargo.toml | 1 + arrow-cast/src/parse.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arrow-cast/Cargo.toml b/arrow-cast/Cargo.toml index 19b857297d14..5a144fe1848b 100644 --- a/arrow-cast/Cargo.toml +++ b/arrow-cast/Cargo.toml @@ -49,6 +49,7 @@ chrono = { workspace = true } half = { version = "2.1", default-features = false } num = { version = "0.4", default-features = false, features = ["std"] } lexical-core = { version = "^0.8", default-features = false, features = ["write-integers", "write-floats", "parse-integers", "parse-floats"] } +atoi_simd = "0.15.6" comfy-table = { version = "7.0", optional = true, default-features = false } base64 = "0.21" diff --git a/arrow-cast/src/parse.rs b/arrow-cast/src/parse.rs index e39e0964bc5b..f81bd2105bf3 100644 --- a/arrow-cast/src/parse.rs +++ b/arrow-cast/src/parse.rs @@ -438,7 +438,7 @@ macro_rules! parser_primitive { ($t:ty) => { impl Parser for $t { fn parse(string: &str) -> Option { - string.parse::().ok() + atoi_simd::parse(string.as_bytes()).ok() } } };