Use Vec for primitive array unary operations - #10783
Conversation
|
run benchmark primitive_array |
|
Hi @kowanietz, thanks for the request (#10783 (comment)). Only whitelisted users can trigger benchmarks. Allowed users: 2010YOUY01, Dandandan, Fokko, Jefffrey, Omega359, Rachelint, Rich-T-kid, adriangb, alamb, asubiotto, brunal, buraksenn, cetra3, codephage2020, coderfender, comphead, erenavsarogullari, etseidl, friendlymatthew, gabotechs, geoffreyclaude, grtlr, haohuaijin, jonathanc-n, kevinjqliu, klion26, kosiew, kumarUjjawal, kunalsinghdadhwal, liamzwbao, mbutrovich, mkleen, mzabaluev, neilconway, rluvaton, sdf-jkl, timsaucer, xudong963, zhuqi-lucas. File an issue against this benchmark runner |
|
Well, that's unfortunate. Btw, in case the benchmark I added is out of scope, I'll remove it or move it to another PR :) |
|
run benchmark primitive_array |
|
🤖 Arrow criterion benchmark running (GKE) | trigger CPU Details (lscpu)Comparing perf/primitive-array-vec (52b4cdd) to c837ee8 (merge-base) diff Run configurationrun benchmark primitive_arrayBENCH_COMMAND=cargo bench --features=arrow,async,test_common,experimental,object_store --bench primitive_array File an issue against this benchmark runner |
Rich-T-kid
left a comment
There was a problem hiding this comment.
Well, that's unfortunate.
Btw, in case the benchmark I added is out of scope, I'll remove it or move it to another PR :)
@kowanietz yea you'd need to add the benchmarks in a separate PR to use the benchmarks bot to compare the results. I dont think thats actually needed for this PR, see @/alamb comment here apache/datafusion#24071 (comment)
LGTM
|
🤖 Arrow criterion benchmark completed (GKE) | trigger Instance: Comparing perf/primitive-array-vec (52b4cdd) to c837ee8 (merge-base) diff Run configurationrun benchmark primitive_arrayCPU Details (lscpu)New benchmark — branch-only results (no baseline comparison) Details
Resource Usagebranch
File an issue against this benchmark runner |
Jefffrey
left a comment
There was a problem hiding this comment.
matches my bench results locally too
primitive_array_unary/try_unary/no_input_nulls
time: [4.4402 µs 4.4502 µs 4.4598 µs]
+ change: [−15.956% −15.699% −15.431%] (p = 0.00 < 0.05)
+ Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) low severe
1 (1.00%) low mild
3 (3.00%) high mild
primitive_array_unary/unary_opt/no_input_nulls
time: [25.532 µs 25.647 µs 25.761 µs]
- change: [+1.8110% +2.1490% +2.4997%] (p = 0.00 < 0.05)
- Performance has regressed.
Found 15 outliers among 100 measurements (15.00%)
12 (12.00%) high mild
3 (3.00%) high severe
primitive_array_unary/try_unary/20pct_input_nulls
time: [27.961 µs 27.990 µs 28.021 µs]
+ change: [−5.3402% −5.0562% −4.7822%] (p = 0.00 < 0.05)
+ Performance has improved.
Found 11 outliers among 100 measurements (11.00%)
3 (3.00%) low severe
4 (4.00%) low mild
1 (1.00%) high mild
3 (3.00%) high severe
primitive_array_unary/unary_opt/20pct_input_nulls
time: [38.286 µs 38.346 µs 38.414 µs]
change: [−1.6937% −1.1508% −0.6379%] (p = 0.00 < 0.05)
Change within noise threshold.
Found 15 outliers among 100 measurements (15.00%)
2 (2.00%) low mild
13 (13.00%) high severe- 1st one has improvement, other 3 probably just noise
|
thanks @kowanietz & @Rich-T-kid |
Which issue does this PR close?
OffsetBufferBuilder/BufferBuilderusage withVec, when possible #10245Rationale for this change
Replacing
BufferBuilderwithVecimproves the performenace of primitive array unary operations.What changes are included in this PR?
Replaces the
BufferBuilder<...>usages inPrimitiveArray::try_unaryandPrimitiveArray::unary_optwithVecs.Also adds benchmarks for both operations with and without input nulls
Are these changes tested?
All tests pass:
cargo fmt --all -- --checkcargo clippy -p arrow-array --all-targets --all-features --no-deps -- -D warningscargo test -p arrow-array --all-featurescargo bench -p arrow-array --bench primitive_array -- --testLocal benchmark results for 65,536
Int32values:try_unary, no input nullstry_unary, 20% input nullsunary_opt, no input nullsunary_opt, 20% input nullsI currently only have a MacBook available so benching this on Linux would probably make sense.
Are there any user-facing changes?
No.