chore: add cast_decimal benchmark#6850
Merged
tustvold merged 3 commits intoapache:mainfrom Dec 11, 2024
Merged
Conversation
alamb
reviewed
Dec 6, 2024
Contributor
alamb
left a comment
There was a problem hiding this comment.
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![ |
Contributor
There was a problem hiding this comment.
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}; |
Contributor
There was a problem hiding this comment.
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
Member
Author
There was a problem hiding this comment.
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)))
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?