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

alamb 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 75954173ad fix: `view_types` benchmark slice should follow by correct 
len array (#7892)
75954173ad is described below

commit 75954173ada9868cc8a695f02eb7ec2a78159245
Author: Qi Zhu <821684...@qq.com>
AuthorDate: Fri Jul 11 00:00:00 2025 +0800

    fix: `view_types` benchmark slice should follow by correct len array (#7892)
    
    # Which issue does this PR close?
    
    Fix the bug that view types slice benchmark not using the right len
    after we added new benchmark.
    
    
    # Rationale for this change
    
    Fix the bug that view types slice benchmark not using the right len
    after we added new benchmark.
    
    # What changes are included in this PR?
    
    Fix the bug that view types slice benchmark not using the right len
    after we added new benchmark.
    
    # Are these changes tested?
    
    Yes
    
    # Are there any user-facing changes?
    
    No
---
 arrow-array/benches/view_types.rs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arrow-array/benches/view_types.rs 
b/arrow-array/benches/view_types.rs
index b5d74517b8..986d4c65c1 100644
--- a/arrow-array/benches/view_types.rs
+++ b/arrow-array/benches/view_types.rs
@@ -42,6 +42,12 @@ fn gen_view_array_without_nulls(size: usize) -> 
StringViewArray {
 fn criterion_benchmark(c: &mut Criterion) {
     let array = gen_view_array(100_000);
 
+    c.bench_function("view types slice", |b| {
+        b.iter(|| {
+            black_box(array.slice(0, 100_000 / 2));
+        });
+    });
+
     c.bench_function("gc view types all[100000]", |b| {
         b.iter(|| {
             black_box(array.gc());
@@ -99,12 +105,6 @@ fn criterion_benchmark(c: &mut Criterion) {
             black_box(sliced.gc());
         });
     });
-
-    c.bench_function("view types slice", |b| {
-        b.iter(|| {
-            black_box(array.slice(0, 100_000 / 2));
-        });
-    });
 }
 
 criterion_group!(benches, criterion_benchmark);

Reply via email to