Repository navigation
perf: Add a dictionary cache for parquet dict types - #11982
Conversation
…iginal dict, so we only hash once
|
run benchmark arrow_writer |
|
🤖 Benchmark starting (GKE) | trigger Target: arrow_writer Sharding factor: 1 (1 workers). Comparing parquet-dictionary-cache (c19410f) to cacb42e (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: string_dictionary
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark arrow_writer |
|
🤖 Benchmark starting (GKE) | trigger Target: arrow_writer Sharding factor: 1 (1 workers). Comparing parquet-dictionary-cache (c19410f) to cacb42e (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: string_ree_of_dict
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark arrow_writer |
|
🤖 Benchmark starting (GKE) | trigger Target: arrow_writer Sharding factor: 1 (1 workers). Comparing parquet-dictionary-cache (c19410f) to cacb42e (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: ree_struct_of_dict
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: arrow_writer Comparing parquet-dictionary-cache (c19410f) to cacb42e (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: string_ree_of_dict
shards: 1
DetailsPer-runner informationarrow_writer — shard 1/1Node: gk3-benchmark-cluster-nap-3aaq6n7v-edc0ea33-4ppc Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writerCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: arrow_writer Comparing parquet-dictionary-cache (c19410f) to cacb42e (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: ree_struct_of_dict
shards: 1
DetailsPer-runner informationarrow_writer — shard 1/1Node: gk3-benchmark-cluster-nap-3aaq6n7v-edc0ea33-tnxw Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writerCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: arrow_writer Comparing parquet-dictionary-cache (c19410f) to cacb42e (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: string_dictionary
shards: 1
DetailsPer-runner informationarrow_writer — shard 1/1Node: gk3-benchmark-cluster-nap-1idxzbee-33b9562b-bkh5 Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writerCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
Rich-T-kid
left a comment
There was a problem hiding this comment.
thanks @EmilyMatt this is looking good. benchmarks look very strong!
I left a few comments feel free to ping me for another review once those are addressed 🙇
|
@Rich-T-kid I believe this is ready for review again |
|
run benchmark arrow_writer |
|
🤖 Benchmark starting (GKE) | trigger Target: arrow_writer Sharding factor: 1 (1 workers). Comparing parquet-dictionary-cache (5e1df3f) to 89fc173 (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: ree_struct_of_dict
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
run benchmark arrow_writer |
|
🤖 Benchmark starting (GKE) | trigger Target: arrow_writer Sharding factor: 1 (1 workers). Comparing parquet-dictionary-cache (5e1df3f) to 89fc173 (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: ree_struct_of_dict
shards: 1
Results will be posted when all workers finish. File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: arrow_writer Comparing parquet-dictionary-cache (5e1df3f) to 89fc173 (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: ree_struct_of_dict
shards: 1
DetailsPer-runner informationarrow_writer — shard 1/1Node: gk3-benchmark-cluster-nap-15byy74d-2cdb697e-pxsn Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writerCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Target: arrow_writer Comparing parquet-dictionary-cache (5e1df3f) to 89fc173 (merge-base) diff Run configurationrun benchmark arrow_writer
env:
BENCH_FILTER: ree_struct_of_dict
shards: 1
DetailsPer-runner informationarrow_writer — shard 1/1Node: gk3-benchmark-cluster-nap-15byy74d-5558d1dd-mbrt Instance: c4a-highmem-16 (12 vCPU / 65 GiB) uname: BENCH_COMMAND: cargo bench --features=arrow,async,test_common,experimental,object_store --bench arrow_writerCPU Details (lscpu)Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
Rich-T-kid
left a comment
There was a problem hiding this comment.
left a comment but this looks good to me, thanks @EmilyMatt
cc @HippoBaro in case your interested in taking a look
|
thanks @EmilyMatt |
Rationale for this change
Since we already get a dictionary type, we can just calculate hash once per entry, until the dictionary provider changes.
What changes are included in this PR?
Use a Weak ref (so we don't hold the dict alive), and encode each entry only once, the moment the dict changes, clear the current hashes, should be a huge improvement to perf.
Made some private functions use slices directly.
Are these changes tested?
Yes.
Local benchmark results:
string/defaultstring/parquet_2string_dictionary/defaultstring_dictionary/parquet_2string_dictionary_low_cardinality_100/defaultstring_dictionary_low_cardinality_100/parquet_2string_non_null/defaultstring_non_null/parquet_2string_ree_of_dict/defaultstring_ree_of_dict/parquet_2Are there any significant user-facing changes?
No