-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add cast_decimal benchmark #6850
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andygrove -- I left some comments -- let me know what you think
arrow-cast/benches/cast_decimal.rs
Outdated
|
||
fn criterion_benchmark(c: &mut Criterion) { | ||
let decimals: ArrayRef = Arc::new( | ||
Decimal128Array::from(vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend creating a slightly larger array that mirrors actual workloads (e.g. 4k or 8k values, maybe just repeating these values multiple times).
Using a small array like may amplify the overheads of function invocation compared to the actual work being done
arrow-cast/benches/cast_decimal.rs
Outdated
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
use arrow_array::{ArrayRef, Decimal128Array}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should put this along side the other benchmarks for cast
in https://github.com/apache/arrow-rs/blob/main/arrow/benches/cast_kernels.rs#L1-L0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and it turns out that we already have tests for this that I can easily modify 🙄
c.bench_function("cast decimal128 to decimal128 512", |b| {
b.iter(|| cast_array(&decimal128_array, DataType::Decimal128(30, 5)))
});
Which issue does this PR close?
Part of #6833
Rationale for this change
We need a benchmark to help review #6836
What changes are included in this PR?
Are there any user-facing changes?