Skip to content

Commit

Permalink
chore: Move to fast-float2 (#19578)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Nov 1, 2024
1 parent 049f038 commit 3d124c5
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 76 deletions.
135 changes: 71 additions & 64 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ crossbeam-utils = "0.8.20"
either = "1.11"
ethnum = "1.3.2"
fallible-streaming-iterator = "0.1.9"
fast-float = { version = "0.2" }
fast-float2 = { version = "^0.2.2" }
flate2 = { version = "1", default-features = false }
futures = "0.3.25"
hashbrown = { version = "0.15.0", features = ["rayon", "serde"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ethnum = { workspace = true }

# To efficiently cast numbers to strings
atoi_simd = { workspace = true, optional = true }
fast-float = { workspace = true, optional = true }
fast-float2 = { workspace = true, optional = true }
itoa = { workspace = true, optional = true }
itoap = { workspace = true, optional = true }
ryu = { workspace = true, optional = true }
Expand Down Expand Up @@ -128,7 +128,7 @@ compute_arithmetics = ["strength_reduce", "compute_arithmetics_decimal"]
compute_bitwise = []
compute_boolean = []
compute_boolean_kleene = []
compute_cast = ["compute_take", "ryu", "atoi_simd", "itoa", "fast-float"]
compute_cast = ["compute_take", "ryu", "atoi_simd", "itoa", "fast-float2"]
compute_comparison = ["compute_take", "compute_boolean"]
compute_hash = ["multiversion"]
compute_take = []
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-arrow/src/compute/cast/binary_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ impl Parse for f32 {
where
Self: Sized,
{
fast_float::parse(val).ok()
fast_float2::parse(val).ok()
}
}
impl Parse for f64 {
fn parse(val: &[u8]) -> Option<Self>
where
Self: Sized,
{
fast_float::parse(val).ok()
fast_float2::parse(val).ok()
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/polars-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ blake3 = { version = "1.5.1", optional = true }
bytes = { workspace = true }
chrono = { workspace = true, optional = true }
chrono-tz = { workspace = true, optional = true }
fast-float = { workspace = true, optional = true }
fast-float2 = { workspace = true, optional = true }
flate2 = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
glob = { version = "0.3" }
Expand All @@ -52,7 +52,7 @@ url = { workspace = true, optional = true }
zstd = { workspace = true, optional = true }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
fs4 = { version = "0.9", features = ["sync"], optional = true }
fs4 = { version = "0.10", features = ["sync"], optional = true }
home = "0.5.4"

[dev-dependencies]
Expand All @@ -75,7 +75,7 @@ ipc = ["arrow/io_ipc", "arrow/io_ipc_compression"]
ipc_streaming = ["arrow/io_ipc", "arrow/io_ipc_compression"]
# support for arrow avro parsing
avro = ["arrow/io_avro", "arrow/io_avro_compression"]
csv = ["atoi_simd", "polars-core/rows", "itoa", "ryu", "fast-float", "simdutf8"]
csv = ["atoi_simd", "polars-core/rows", "itoa", "ryu", "fast-float2", "simdutf8"]
decompress = ["flate2/rust_backend", "zstd"]
decompress-fast = ["flate2/zlib-ng", "zstd"]
dtype-u8 = ["polars-core/dtype-u8"]
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-io/src/csv/read/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ pub(crate) trait PrimitiveParser: PolarsNumericType {
impl PrimitiveParser for Float32Type {
#[inline]
fn parse(bytes: &[u8]) -> Option<f32> {
fast_float::parse(bytes).ok()
fast_float2::parse(bytes).ok()
}
}
impl PrimitiveParser for Float64Type {
#[inline]
fn parse(bytes: &[u8]) -> Option<f64> {
fast_float::parse(bytes).ok()
fast_float2::parse(bytes).ok()
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/polars-parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ streaming-decompression = "0.1"

async-stream = { version = "0.3.3", optional = true }

brotli = { version = "^6.0", optional = true }
brotli = { version = "^7.0", optional = true }
flate2 = { workspace = true, optional = true }
lz4 = { version = "1.24", optional = true }
lz4_flex = { version = "0.11", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ raw-cpuid = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true, optional = true }
stacker = { workspace = true }
sysinfo = { version = "0.31", default-features = false, features = ["system"], optional = true }
sysinfo = { version = "0.32", default-features = false, features = ["system"], optional = true }

[dev-dependencies]
rand = { workspace = true }
Expand Down

0 comments on commit 3d124c5

Please sign in to comment.