Jefffrey commented on PR #10396:
URL: https://github.com/apache/arrow-rs/pull/10396#issuecomment-5055932404
something silly we could do is always assume the best case and have the
worst case (need to trim) as a fallback
```rust
impl Parser for Float32Type {
fn parse(string: &str) -> Option<f32> {
if let Ok(n) = lexical_core::parse(string.as_bytes()) {
Some(n)
} else {
let string = string.trim_ascii();
lexical_core::parse(string.as_bytes()).ok()
}
}
}
```
----
since the benchmarks are testing the casting of arrays themselves (and not
just a microbenchmark of this parse function) i think it would be good to aim
for a way to avoid regressions if possible 🤔
that being said, its worth noting our benchmark only checks f32, and tests
arrays of fixed 512 length, so its not like the suite is comprehensive to the
changes being made here
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]