This is an automated email from the ASF dual-hosted git repository.

Jefffrey pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new f7dfcd25aa add i32 benchmarks (#10421)
f7dfcd25aa is described below

commit f7dfcd25aabeb01641fe4b6c35ab964fdf0b24aa
Author: RIchard Baah <[email protected]>
AuthorDate: Fri Jul 24 00:03:41 2026 -0400

    add i32 benchmarks (#10421)
    
    # Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax.
    -->
    
    - none.
    
    # Rationale for this change
    see https://github.com/apache/arrow-rs/pull/10396#discussion_r3642456653
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    -->
    
    # What changes are included in this PR?
    adds benchmarks for str -> i32
    <!--
    There is no need to duplicate the description in the issue here but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    # Are these changes tested?
    n/a
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    
    If this PR claims a performance improvement, please include evidence
    such as benchmark results.
    -->
    
    # Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    
    If there are any breaking changes to public APIs, please call them out.
    -->
    no
---
 arrow/benches/cast_kernels.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arrow/benches/cast_kernels.rs b/arrow/benches/cast_kernels.rs
index 7e98168924..85287a8c40 100644
--- a/arrow/benches/cast_kernels.rs
+++ b/arrow/benches/cast_kernels.rs
@@ -214,6 +214,7 @@ fn add_benchmark(c: &mut Criterion) {
     let i64_array = build_array::<Int64Type>(512);
     let f32_array = build_array::<Float32Type>(512);
     let f32_utf8_array = cast(&build_array::<Float32Type>(512), 
&DataType::Utf8).unwrap();
+    let i32_utf8_array = cast(&build_array::<Int32Type>(512), 
&DataType::Utf8).unwrap();
 
     let f64_array = build_array::<Float64Type>(512);
     let date64_array = build_array::<Date64Type>(512);
@@ -300,6 +301,9 @@ fn add_benchmark(c: &mut Criterion) {
     c.bench_function("cast utf8 to f32", |b| {
         b.iter(|| cast_array(&f32_utf8_array, DataType::Float32))
     });
+    c.bench_function("cast utf8 to i32", |b| {
+        b.iter(|| cast_array(&i32_utf8_array, DataType::Int32))
+    });
     c.bench_function("cast i64 to string 512", |b| {
         b.iter(|| cast_array(&i64_array, DataType::Utf8))
     });

Reply via email to