Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
tlm365 committed Dec 8, 2024
1 parent 3e12dba commit d446876
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions datafusion/functions/benches/initcap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,32 @@ fn criterion_benchmark(c: &mut Criterion) {
let initcap = string::initcap();
for size in [1024, 4096] {
let args = create_args::<i32>(size, 8, true);
c.bench_function(format!("initcap string view shorter than 12 [size={}]", size).as_str(), |b| {
b.iter(|| {
black_box(initcap.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
number_rows: size,
return_type: &DataType::Utf8View,
}))
})
});
c.bench_function(
format!("initcap string view shorter than 12 [size={}]", size).as_str(),
|b| {
b.iter(|| {
black_box(initcap.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
number_rows: size,
return_type: &DataType::Utf8View,
}))
})
},
);

let args = create_args::<i32>(size, 16, true);
c.bench_function(format!("initcap string view longer than 12 [size={}]", size).as_str(), |b| {
b.iter(|| {
black_box(initcap.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
number_rows: size,
return_type: &DataType::Utf8View,
}))
})
});
c.bench_function(
format!("initcap string view longer than 12 [size={}]", size).as_str(),
|b| {
b.iter(|| {
black_box(initcap.invoke_with_args(ScalarFunctionArgs {
args: args.clone(),
number_rows: size,
return_type: &DataType::Utf8View,
}))
})
},
);

let args = create_args::<i32>(size, 16, false);
c.bench_function(format!("initcap string [size={}]", size).as_str(), |b| {
Expand Down

0 comments on commit d446876

Please sign in to comment.