Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4481358430 > Thanks @alamb and @Dandandan for the reviews! I'm pulling this one in now, will likely invest some more time in this operator to catch some other low hanging fruits LOL I am not sure there are many **low hanging** fruits in the operator, but I think any improvements you can make will make a big different to performance. RepartitionExec is one of the most performance critical operators we have in the system I think Here is one idea for your amusement (I think it could be a pretty big win for queries that repartition a lot of rows, esp if those rows are strings) - https://github.com/apache/datafusion/issues/11680 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs merged PR #22010: URL: https://github.com/apache/datafusion/pull/22010 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4474642172 Thanks @alamb and @Dandandan for the reviews! I'm pulling this one in now, will likely invest some more time in this operator to catch some other low hanging fruits -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
zhuqi-lucas commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4469398587 Nice improvement! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3252989571
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3252985988
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
Review Comment:
No longer relevant, as this part of the code has been left untouched in the
end.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4466084628 Very cool!! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460641826 Those are some sweet performance numbers -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460225272 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpcds_sf1.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β56.99 / 58.21 Β±1.04 / 60.07 ms β 56.77 / 57.98 Β±1.08 / 59.99 ms β no change β β QQuery 2 β 292.04 / 298.30 Β±5.49 / 306.15 ms β 285.58 / 305.41 Β±11.75 / 318.19 ms β no change β β QQuery 3 β71.29 / 76.51 Β±3.24 / 80.46 ms β 72.56 / 77.31 Β±2.94 / 81.73 ms β no change β β QQuery 4 β783.80 / 804.25 Β±14.52 / 826.83 ms β 787.12 / 824.67 Β±21.68 / 848.88 ms β no change β β QQuery 5 β632.55 / 647.58 Β±10.82 / 663.25 ms β 598.86 / 623.84 Β±20.94 / 652.08 ms β no change β β QQuery 6 β 148.31 / 154.42 Β±5.73 / 164.46 ms β 153.77 / 160.32 Β±7.32 / 173.84 ms β no change β β QQuery 7 β 829.31 / 841.31 Β±9.88 / 856.13 ms β 851.73 / 869.40 Β±11.99 / 886.72 ms β no change β β QQuery 8 β 147.42 / 151.08 Β±2.69 / 155.26 ms β 150.22 / 157.78 Β±3.90 / 160.83 ms β no change β β QQuery 9 β234.49 / 257.44 Β±17.51 / 276.96 ms β 222.10 / 232.19 Β±7.40 / 241.07 ms β +1.11x faster β β QQuery 10 β 155.97 / 159.73 Β±4.34 / 168.09 ms β 158.81 / 160.57 Β±1.92 / 163.81 ms β no change β β QQuery 11 β518.71 / 543.21 Β±14.30 / 561.60 ms β 517.88 / 536.85 Β±13.37 / 558.45 ms β no change β β QQuery 12 β 103.99 / 109.75 Β±5.93 / 118.11 ms β 104.17 / 108.96 Β±2.98 / 112.45 ms β no change β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460191800 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark clickbench_partitioned.json βββββ³β³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘βββββββββββ© β QQuery 0 β 1.52 / 5.09 Β±7.00 / 19.08 ms β 1.54 / 5.05 Β±6.91 / 18.87 ms β no change β β QQuery 1 β 21.89 / 24.42 Β±1.42 / 25.95 ms β 22.22 / 24.21 Β±1.31 / 26.27 ms β no change β β QQuery 2 β 47.96 / 49.11 Β±1.79 / 52.63 ms β 48.64 / 50.04 Β±1.00 / 51.76 ms β no change β β QQuery 3 β 38.56 / 39.16 Β±0.47 / 39.64 ms β 38.32 / 40.06 Β±1.69 / 42.36 ms β no change β β QQuery 4 β 341.04 / 351.42 Β±7.42 / 361.45 ms β 235.37 / 247.97 Β±11.83 / 269.43 ms β +1.42x faster β β QQuery 5 β 379.12 / 382.16 Β±3.44 / 388.47 ms β 315.52 / 317.97 Β±1.78 / 320.99 ms β +1.20x faster β β QQuery 6 β 21.51 / 22.16 Β±0.80 / 23.48 ms β 20.39 / 21.91 Β±1.06 / 23.49 ms β no change β β QQuery 7 β 52.46 / 53.68 Β±1.03 / 55.25 ms β 53.44 / 56.01 Β±2.98 / 61.76 ms β no change β β QQuery 8 β 508.13 / 512.85 Β±3.37 / 516.94 ms β 365.75 / 368.89 Β±2.31 / 372.42 ms β +1.39x faster β β QQuery 9 β 393.39 / 403.30 Β±9.01 / 414.29 ms β 402.83 / 414.62 Β±10.30 / 430.26 ms β no change β β QQuery 10 β 149.17 / 152.05 Β±2.66 / 156.80 ms β 139.44 / 141.93 Β±2.66 / 147.10 ms β +1.07x faster β β QQuery 11 β 159.97 / 162.77 Β±2.14 / 166.03 ms β 153.32 / 156.35 Β±2.43 / 160.62 ms β no change β β QQuery 12 β 384.87 / 390.
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460173228 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf1.json βββββ³β³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘βββββββββββ© β QQuery 1 β 79.56 / 81.97 Β±1.85 / 85.24 ms β 79.83 / 81.26 Β±1.69 / 83.39 ms β no change β β QQuery 2 β 81.07 / 83.04 Β±1.87 / 86.20 ms β 81.42 / 84.29 Β±2.72 / 88.79 ms β no change β β QQuery 3 β 382.63 / 404.83 Β±25.72 / 454.94 ms β 330.88 / 360.87 Β±15.99 / 376.79 ms β +1.12x faster β β QQuery 4 β 67.38 / 69.36 Β±2.50 / 74.21 ms β 64.34 / 68.78 Β±4.03 / 74.06 ms β no change β β QQuery 5 β 614.57 / 681.29 Β±34.68 / 711.72 ms β 561.06 / 587.51 Β±33.33 / 650.88 ms β +1.16x faster β β QQuery 6 β 29.02 / 31.35 Β±1.73 / 33.85 ms β 27.00 / 28.33 Β±1.44 / 31.13 ms β +1.11x faster β β QQuery 7 β 655.43 / 672.57 Β±15.06 / 698.14 ms β 616.90 / 664.13 Β±25.65 / 687.78 ms β no change β β QQuery 8 β 634.04 / 656.89 Β±16.55 / 683.19 ms β 604.92 / 639.78 Β±27.76 / 674.08 ms β no change β β QQuery 9 β 599.65 / 626.80 Β±20.45 / 661.04 ms β 556.69 / 577.91 Β±13.45 / 598.83 ms β +1.08x faster β β QQuery 10 β 115.16 / 125.34 Β±7.60 / 136.35 ms β 114.29 / 121.75 Β±9.27 / 139.82 ms β no change β β QQuery 11 β 85.64 / 88.49 Β±2.04 / 91.23 ms β 84.76 / 89.74 Β±2.92 / 93.18 ms β no change β β QQuery 12 β 648.30 / 677.95 Β±21.35 / 703.07 ms β 660.48 / 669.96 Β±7.88 / 680.50 ms β no change β β QQuery 13 β 279.84 / 302.90 Β±19.09 / 333.65 ms β 287.20 / 298.27 Β±9.26 / 315.28 m
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460101524 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4386511709) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 364.78 / 366.75 Β±1.67 / 369.01 ms β 358.36 / 361.40 Β±2.40 / 364.27 ms β no change β β QQuery 2 β 1256.51 / 1320.97 Β±43.17 / 1364.14 ms β 1121.59 / 1173.06 Β±40.38 / 1219.22 ms β +1.13x faster β β QQuery 3 β 1757.31 / 1803.39 Β±28.63 / 1841.82 ms β 1247.53 / 1327.84 Β±43.03 / 1377.25 ms β +1.36x faster β β QQuery 4 β845.21 / 877.25 Β±19.55 / 899.84 ms β 587.63 / 605.98 Β±12.98 / 622.54 ms β +1.45x faster β β QQuery 5 β 2089.77 / 2156.19 Β±39.55 / 2197.03 ms β 1515.59 / 1548.80 Β±25.56 / 1583.01 ms β +1.39x faster β β QQuery 6 β 137.93 / 143.26 Β±3.79 / 148.21 ms β 135.14 / 137.68 Β±2.62 / 142.44 ms β no change β β QQuery 7 β 2427.79 / 2479.68 Β±48.56 / 2544.70 ms β 1819.85 / 1833.80 Β±11.81 / 1855.69 ms β +1.35x faster β β QQuery 8 β 2687.47 / 2723.97 Β±22.38 / 2756.85 ms β 2081.70 / 2143.69 Β±51.83 / 2230.41 ms β +1.27x faster β β QQuery 9 β 2872.66 / 2948.19 Β±46.84 / 3019.35 ms β 1997.18 / 2037.50 Β±40.03 / 2113.29 ms β +1.45x faster β β QQuery 10 β 1432.53 / 1473.99 Β±26.80 / 1517.14 ms β 1302.06 / 1318.92 Β±15.28 / 1341.64 ms β +1.12x faster β β QQuery 11 β 985.33 / 1000.86 Β±19.76 / 1037.91 ms β 803.64 / 874.05 Β±47.61 / 925.74 ms β +1.15x faster β β QQuery 12 β773.43 / 792.03 Β±16.55 / 818.42 ms β 689.61 / 795.63 Β±63.37 / 853.44 ms β no change β β QQuery 13 β756.91 / 783.87 Β±22.27 / 814.61 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460102761 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4385685216) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 360.17 / 362.05 Β±1.85 / 365.43 ms β 356.93 / 359.69 Β±2.15 / 362.92 ms β no change β β QQuery 2 β 1270.51 / 1345.26 Β±57.44 / 1425.80 ms β 1122.37 / 1173.55 Β±40.05 / 1226.90 ms β +1.15x faster β β QQuery 3 β 1724.88 / 1766.32 Β±23.56 / 1792.36 ms β 1317.30 / 1354.35 Β±26.43 / 1384.13 ms β +1.30x faster β β QQuery 4 β860.64 / 891.22 Β±18.17 / 915.78 ms β 590.59 / 612.66 Β±13.87 / 631.01 ms β +1.45x faster β β QQuery 5 β 2086.63 / 2149.82 Β±38.71 / 2202.07 ms β 1449.89 / 1507.71 Β±36.46 / 1559.81 ms β +1.43x faster β β QQuery 6 β 141.67 / 145.78 Β±2.07 / 147.02 ms β 136.98 / 138.92 Β±1.37 / 140.55 ms β no change β β QQuery 7 β 2405.04 / 2474.71 Β±49.75 / 2532.86 ms β 1790.30 / 1824.28 Β±29.23 / 1873.00 ms β +1.36x faster β β QQuery 8 β 2726.63 / 2759.38 Β±34.06 / 2801.53 ms β 2087.74 / 2135.56 Β±48.96 / 2226.01 ms β +1.29x faster β β QQuery 9 β 2864.29 / 2926.43 Β±44.12 / 2994.44 ms β 2038.66 / 2053.80 Β±12.20 / 2068.33 ms β +1.42x faster β β QQuery 10 β 1437.56 / 1485.28 Β±25.25 / 1509.78 ms β 1338.68 / 1355.72 Β±18.81 / 1385.92 ms β +1.10x faster β β QQuery 11 β 987.14 / 1021.70 Β±27.27 / 1059.03 ms β 839.11 / 867.91 Β±20.15 / 895.25 ms β +1.18x faster β β QQuery 12 β786.01 / 800.12 Β±11.06 / 816.65 ms β 725.45 / 794.42 Β±42.47 / 845.15 ms β no change β β QQuery 13 β715.81 / 769.15 Β±27.72 / 795.64 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460101478 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4372819392) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark clickbench_partitioned.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 0 β 1.19 / 4.67 Β±6.84 / 18.34 ms β 1.19 / 4.60 Β±6.75 / 18.11 ms β no change β β QQuery 1 β12.45 / 12.91 Β±0.23 / 13.09 ms β 12.37 / 12.90 Β±0.65 / 14.16 ms β no change β β QQuery 2 β36.17 / 36.59 Β±0.39 / 37.08 ms β 35.18 / 35.33 Β±0.20 / 35.73 ms β no change β β QQuery 3 β30.63 / 31.52 Β±0.76 / 32.52 ms β 30.38 / 30.50 Β±0.11 / 30.65 ms β no change β β QQuery 4 β 229.08 / 235.49 Β±6.78 / 247.29 ms β 221.83 / 225.31 Β±3.21 / 231.25 ms β no change β β QQuery 5 β 275.62 / 277.09 Β±1.30 / 279.44 ms β 270.59 / 274.65 Β±2.63 / 278.42 ms β no change β β QQuery 6 β 7.09 / 7.64 Β±0.48 / 8.24 ms β 6.34 / 6.76 Β±0.29 / 7.25 ms β +1.13x faster β β QQuery 7 β13.87 / 13.95 Β±0.08 / 14.04 ms β 13.75 / 13.86 Β±0.08 / 13.99 ms β no change β β QQuery 8 β 311.82 / 315.00 Β±2.65 / 318.26 ms β 307.77 / 309.90 Β±2.61 / 314.62 ms β no change β β QQuery 9 β 447.21 / 451.62 Β±3.37 / 456.77 ms β 451.58 / 458.13 Β±6.39 / 470.26 ms β no change β β QQuery 10 β68.02 / 69.70 Β±1.49 / 72.13 ms β 69.47 / 70.87 Β±1.14 / 72.73 ms β no change β β QQuery 11 β78.82 / 80.22 Β±0.92 / 81.42 ms β 80.62 / 83.90 Β±4.21 / 92.10 ms β no change β β QQuery 12 β 272.95 / 275.82 Β±3.62 / 282.2
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460099402 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4459957969) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark clickbench_partitioned.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 0 β 1.21 / 4.81 Β±7.08 / 18.96 ms β 1.20 / 4.55 Β±6.66 / 17.86 ms β +1.06x faster β β QQuery 1 β12.47 / 12.86 Β±0.21 / 13.03 ms β 12.37 / 12.44 Β±0.06 / 12.55 ms β no change β β QQuery 2 β35.91 / 36.53 Β±0.53 / 37.46 ms β 34.94 / 35.15 Β±0.21 / 35.53 ms β no change β β QQuery 3 β30.45 / 31.50 Β±0.75 / 32.76 ms β 30.09 / 30.44 Β±0.42 / 31.24 ms β no change β β QQuery 4 β 231.07 / 234.39 Β±4.55 / 243.34 ms β 220.10 / 224.10 Β±2.23 / 226.75 ms β no change β β QQuery 5 β 275.32 / 277.33 Β±1.66 / 280.09 ms β 271.74 / 274.83 Β±2.81 / 279.41 ms β no change β β QQuery 6 β 6.92 / 7.44 Β±0.39 / 8.11 ms β 6.47 / 7.18 Β±0.50 / 7.77 ms β no change β β QQuery 7 β13.72 / 13.78 Β±0.04 / 13.84 ms β 13.46 / 13.52 Β±0.05 / 13.58 ms β no change β β QQuery 8 β 310.07 / 315.11 Β±4.79 / 323.57 ms β 303.43 / 306.90 Β±2.44 / 309.99 ms β no change β β QQuery 9 β 439.88 / 447.49 Β±4.67 / 452.81 ms β 439.60 / 454.54 Β±8.55 / 466.04 ms β no change β β QQuery 10 β68.13 / 69.61 Β±0.92 / 70.74 ms β 69.01 / 69.67 Β±0.50 / 70.47 ms β no change β β QQuery 11 β79.12 / 80.58 Β±1.62 / 83.66 ms β 79.70 / 81.89 Β±1.98 / 85.44 ms β no change β β QQuery 12 β 270.75 / 273.21 Β±2.37 / 276.6
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460099130 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark clickbench_partitioned.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 0 β 1.39 / 4.99 Β±7.04 / 19.06 ms β 1.38 / 4.80 Β±6.76 / 18.32 ms β no change β β QQuery 1 β13.97 / 14.99 Β±0.71 / 16.16 ms β 13.61 / 14.47 Β±0.73 / 15.58 ms β no change β β QQuery 2 β36.88 / 37.50 Β±0.37 / 37.94 ms β 36.32 / 37.41 Β±0.80 / 38.66 ms β no change β β QQuery 3 β30.75 / 31.38 Β±0.60 / 32.52 ms β 30.56 / 30.98 Β±0.48 / 31.88 ms β no change β β QQuery 4 β 231.34 / 234.87 Β±2.63 / 239.26 ms β 198.15 / 200.98 Β±2.60 / 204.99 ms β +1.17x faster β β QQuery 5 β 284.64 / 288.45 Β±3.61 / 294.82 ms β 261.70 / 264.95 Β±3.19 / 270.37 ms β +1.09x faster β β QQuery 6 β 8.98 / 9.79 Β±0.72 / 11.06 ms β 8.93 / 9.32 Β±0.34 / 9.78 ms β no change β β QQuery 7 β17.28 / 17.67 Β±0.36 / 18.32 ms β 17.14 / 17.39 Β±0.14 / 17.50 ms β no change β β QQuery 8 β 325.86 / 330.15 Β±3.56 / 335.07 ms β 284.94 / 288.82 Β±2.39 / 291.68 ms β +1.14x faster β β QQuery 9 β362.82 / 377.72 Β±11.10 / 396.47 ms β 358.25 / 367.30 Β±6.29 / 376.45 ms β no change β β QQuery 10 β74.15 / 75.50 Β±1.03 / 76.69 ms β 74.09 / 75.69 Β±1.55 / 78.37 ms β no change β β QQuery 11 β86.10 / 87.12 Β±1.01 / 89.03 ms β 84.28 / 85.29 Β±0.64 / 86.00 ms β no change β β QQuery 12 β 286.53 / 291.01 Β±6.54 / 303.9
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460097439 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4459959221) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 362.80 / 369.28 Β±4.14 / 374.74 ms β 354.58 / 357.28 Β±2.02 / 359.75 ms β no change β β QQuery 2 β 1030.32 / 1070.23 Β±27.30 / 1105.30 ms β 929.40 / 948.31 Β±15.30 / 968.39 ms β +1.13x faster β β QQuery 3 β 1428.48 / 1510.12 Β±60.82 / 1599.74 ms β 1025.11 / 1082.40 Β±42.05 / 1143.30 ms β +1.40x faster β β QQuery 4 β679.55 / 707.00 Β±26.06 / 753.87 ms β 473.95 / 486.72 Β±8.12 / 498.26 ms β +1.45x faster β β QQuery 5 β 1763.63 / 1777.14 Β±18.22 / 1811.08 ms β 1246.90 / 1266.17 Β±21.99 / 1309.10 ms β +1.40x faster β β QQuery 6 β 135.98 / 138.11 Β±2.17 / 141.38 ms β 139.26 / 142.31 Β±2.61 / 145.90 ms β no change β β QQuery 7 β 1994.20 / 2078.56 Β±57.15 / 2146.21 ms β 1495.18 / 1525.04 Β±16.80 / 1541.29 ms β +1.36x faster β β QQuery 8 β 2315.76 / 2379.24 Β±54.47 / 2471.65 ms β 1774.01 / 1800.37 Β±15.46 / 1818.12 ms β +1.32x faster β β QQuery 9 β 2500.49 / 2593.94 Β±61.10 / 2672.57 ms β 1664.36 / 1732.47 Β±48.21 / 1786.31 ms β +1.50x faster β β QQuery 10 β 1117.29 / 1158.28 Β±39.73 / 1227.75 ms β 1033.69 / 1065.02 Β±15.88 / 1077.76 ms β +1.09x faster β β QQuery 11 β706.46 / 739.96 Β±28.10 / 789.95 ms β 609.80 / 643.39 Β±24.13 / 671.04 ms β +1.15x faster β β QQuery 12 β610.28 / 651.51 Β±36.12 / 703.83 ms β 538.98 / 581.34 Β±32.49 / 621.83 ms β +1.12x faster β β QQuery 13 β616.04 / 636.78 Β±18.23 / 663.22 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460083925 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpcds_sf1.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β12.48 / 13.17 Β±0.86 / 14.83 ms β 12.87 / 13.40 Β±0.80 / 14.98 ms β no change β β QQuery 2 β 103.15 / 105.20 Β±1.32 / 107.25 ms β 103.71 / 104.72 Β±0.92 / 106.28 ms β no change β β QQuery 3 β33.97 / 34.28 Β±0.26 / 34.60 ms β 33.82 / 34.09 Β±0.20 / 34.36 ms β no change β β QQuery 4 β 549.74 / 559.93 Β±9.53 / 576.29 ms β 556.43 / 563.49 Β±6.41 / 574.96 ms β no change β β QQuery 5 β86.84 / 90.00 Β±3.73 / 96.44 ms β 87.39 / 89.56 Β±3.43 / 96.40 ms β no change β β QQuery 6 β46.68 / 47.60 Β±0.69 / 48.70 ms β 46.55 / 47.31 Β±0.68 / 48.30 ms β no change β β QQuery 7 β 158.31 / 160.69 Β±1.66 / 162.52 ms β 164.32 / 165.09 Β±0.92 / 166.87 ms β no change β β QQuery 8 β50.58 / 50.93 Β±0.25 / 51.24 ms β 50.85 / 51.06 Β±0.23 / 51.47 ms β no change β β QQuery 9 β81.07 / 86.49 Β±2.94 / 89.18 ms β 80.76 / 83.61 Β±3.26 / 89.84 ms β no change β β QQuery 10 β 91.84 / 94.77 Β±3.02 / 100.14 ms β 91.76 / 93.92 Β±1.72 / 96.78 ms β no change β β QQuery 11 β 351.81 / 358.28 Β±4.53 / 364.86 ms β 356.06 / 362.01 Β±3.39 / 366.45 ms β no change β β QQuery 12 β35.45 / 37.46 Β±2.89 / 43.08 ms β 35.54 / 36.14 Β±0.48 / 36.88 ms β no change β β QQuery 13 β 146.78 / 149.15 Β±1.60 / 151.64 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460095329 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4376856575) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 350.39 / 354.59 Β±3.47 / 359.74 ms β 350.92 / 353.79 Β±2.68 / 358.82 ms β no change β β QQuery 2 β 1007.37 / 1039.49 Β±27.31 / 1080.20 ms β 949.30 / 964.07 Β±9.51 / 977.80 ms β +1.08x faster β β QQuery 3 β 1434.73 / 1489.95 Β±39.43 / 1555.39 ms β 1062.65 / 1099.58 Β±41.10 / 1177.58 ms β +1.36x faster β β QQuery 4 β 706.00 / 717.79 Β±9.82 / 735.43 ms β 461.41 / 472.96 Β±8.35 / 486.55 ms β +1.52x faster β β QQuery 5 β 1804.39 / 1814.13 Β±8.75 / 1830.10 ms β 1235.67 / 1271.40 Β±34.61 / 1318.44 ms β +1.43x faster β β QQuery 6 β 136.28 / 139.32 Β±3.28 / 144.95 ms β 133.39 / 137.35 Β±3.50 / 142.67 ms β no change β β QQuery 7 β 1968.71 / 2049.00 Β±59.23 / 2136.35 ms β 1498.64 / 1525.24 Β±25.53 / 1564.15 ms β +1.34x faster β β QQuery 8 β 2271.36 / 2303.70 Β±31.39 / 2355.69 ms β 1766.42 / 1794.94 Β±23.21 / 1833.48 ms β +1.28x faster β β QQuery 9 β 2486.73 / 2491.23 Β±5.19 / 2501.01 ms β 1698.33 / 1728.84 Β±20.19 / 1754.60 ms β +1.44x faster β β QQuery 10 β 1138.96 / 1187.00 Β±31.56 / 1232.04 ms β 1047.84 / 1093.66 Β±30.76 / 1141.89 ms β +1.09x faster β β QQuery 11 β724.16 / 750.71 Β±29.62 / 804.20 ms β 630.57 / 650.01 Β±14.29 / 668.60 ms β +1.15x faster β β QQuery 12 β 603.85 / 614.57 Β±7.41 / 623.99 ms β 558.23 / 584.82 Β±19.25 / 613.98 ms β no change β β QQuery 13 β590.15 / 622.78 Β±24.33 / 663.98 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460088972 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373980023-135-tmxg5 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460080631 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4372819392) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpcds_sf1.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 6.34 / 6.91 Β±0.86 / 8.62 ms β 6.39 / 6.88 Β±0.82 / 8.51 ms β no change β β QQuery 2 β82.80 / 83.35 Β±0.29 / 83.58 ms β 81.66 / 82.33 Β±0.39 / 82.70 ms β no change β β QQuery 3 β29.21 / 29.57 Β±0.34 / 30.22 ms β 30.01 / 30.59 Β±0.35 / 31.06 ms β no change β β QQuery 4 β515.41 / 534.29 Β±14.97 / 551.00 ms β 516.80 / 530.23 Β±12.75 / 548.23 ms β no change β β QQuery 5 β52.69 / 53.07 Β±0.30 / 53.53 ms β 53.09 / 53.62 Β±0.76 / 55.11 ms β no change β β QQuery 6 β35.64 / 36.07 Β±0.35 / 36.68 ms β 35.50 / 37.08 Β±1.49 / 39.12 ms β no change β β QQuery 7 β 110.78 / 113.17 Β±1.91 / 115.11 ms β 112.53 / 114.19 Β±1.68 / 116.47 ms β no change β β QQuery 8 β39.70 / 39.79 Β±0.06 / 39.87 ms β 39.24 / 39.43 Β±0.24 / 39.89 ms β no change β β QQuery 9 β53.79 / 55.61 Β±1.53 / 58.29 ms β 54.56 / 56.27 Β±1.63 / 59.05 ms β no change β β QQuery 10 β81.39 / 83.80 Β±2.32 / 87.81 ms β 81.65 / 82.71 Β±1.27 / 84.99 ms β no change β β QQuery 11 β 322.92 / 332.24 Β±6.46 / 342.87 ms β 321.49 / 331.38 Β±10.12 / 348.85 ms β no change β β QQuery 12 β29.80 / 31.24 Β±0.89 / 32.24 ms β 28.81 / 29.04 Β±0.13 / 29.20 ms β +1.08x faster β β QQuery 13 β 128.28 / 129.49 Β±1.01 / 131.22 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460079126 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373980023-134-g8f9z 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpcds Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3248382963
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +153,120 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// Output channel with its associated memory reservation and spill writer.
+///
+/// `coalescer` is `None` for preserve-order mode, where downstream
+/// [`StreamingMergeBuilder`] performs the batching; otherwise it's a
+/// [`SharedCoalescer`] cloned from the per-partition one held by
+/// [`PartitionChannels`].
struct OutputChannel {
sender: DistributionSender,
reservation: SharedMemoryReservation,
spill_writer: SpillPoolWriter,
+shared_coalescer: Option,
+}
+
+impl OutputChannel {
+fn coalesce(&mut self, batch: RecordBatch) -> Result> {
+match &self.shared_coalescer {
+Some(shared) => Ok(shared.push_and_drain(batch)?),
+None => Ok(vec![batch]),
+}
+}
+
+/// Send a single batch through the channel for `partition`, applying
Review Comment:
Maybe worth pointing out in the comment that this is used *after* coalescing
(and doesn't internally coalesce)
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -797,6 +934,34 @@ impl BatchPartitioner {
/// arbitrary interleaving (and thus unordered) unless
/// [`Self::with_preserve_order`] specifies otherwise.
///
+/// # Batch coalescing
+///
+/// Repartitioning one [`RecordBatch`] implies creating multiple smaller
batches, potentially
+/// as many as the number of output partitions. [`RepartitionExec`] makes sure
that the returned
+/// batches adhere to the configured `datafusion.execution.batch_size` for
efficient operations,
+/// and for that, it will automatically coalesce batches right after
repartitioning.
+///
+/// For this, one shared [`LimitedBatchCoalescer`] per output partition is
used:
Review Comment:
love it π
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460078409 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373980023-133-fl7sb 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: clickbench_partitioned Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460066038 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4372819392) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf1.json βββββ³β³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘βββββββββββ© β QQuery 1 β 39.43 / 40.50 Β±1.18 / 42.16 ms β 39.18 / 40.37 Β±1.38 / 42.21 ms β no change β β QQuery 2 β 20.88 / 21.61 Β±0.89 / 23.32 ms β 21.01 / 21.19 Β±0.12 / 21.35 ms β no change β β QQuery 3 β 35.57 / 37.56 Β±1.27 / 38.84 ms β 34.25 / 36.57 Β±1.19 / 37.55 ms β no change β β QQuery 4 β 17.63 / 17.89 Β±0.15 / 18.06 ms β 18.13 / 18.21 Β±0.06 / 18.29 ms β no change β β QQuery 5 β 46.04 / 47.08 Β±0.70 / 48.24 ms β 42.66 / 44.73 Β±1.45 / 46.44 ms β no change β β QQuery 6 β 17.10 / 17.42 Β±0.53 / 18.48 ms β 16.84 / 17.28 Β±0.43 / 18.06 ms β no change β β QQuery 7 β 51.20 / 52.54 Β±1.56 / 55.50 ms β 50.01 / 51.74 Β±1.33 / 53.75 ms β no change β β QQuery 8 β 46.63 / 46.91 Β±0.19 / 47.13 ms β 45.95 / 46.59 Β±0.40 / 47.08 ms β no change β β QQuery 9 β 51.81 / 53.19 Β±1.01 / 54.17 ms β 52.37 / 53.41 Β±0.94 / 55.18 ms β no change β β QQuery 10 β 65.21 / 65.82 Β±0.48 / 66.57 ms β 65.37 / 65.73 Β±0.43 / 66.58 ms β no change β β QQuery 11 β 14.17 / 14.45 Β±0.18 / 14.71 ms β 14.29 / 15.12 Β±1.04 / 16.95 ms β no change β β QQuery 12 β 25.53 / 25.76 Β±0.16 / 26.02 ms β 24.79 / 25.22 Β±0.42 / 25.78 ms β no change β β QQuery 13 β 36.27 / 36.96 Β±0.58 / 37.64 ms β 35.41 / 36.29 Β±0.64 / 37.01 ms β no change β β QQuery 14 β 26.47 / 26.94 Β±0.60 / 28.13
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4460071439 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf1.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β42.02 / 43.09 Β±1.03 / 45.06 ms β 41.88 / 43.14 Β±1.29 / 45.50 ms β no change β β QQuery 2 β29.20 / 29.93 Β±0.57 / 30.85 ms β 28.57 / 29.98 Β±0.95 / 31.13 ms β no change β β QQuery 3 β62.50 / 64.00 Β±1.54 / 66.30 ms β 54.01 / 55.60 Β±0.94 / 56.71 ms β +1.15x faster β β QQuery 4 β24.24 / 24.54 Β±0.28 / 24.98 ms β 24.16 / 24.69 Β±0.38 / 25.17 ms β no change β β QQuery 5 β 90.96 / 94.40 Β±3.24 / 100.48 ms β 80.63 / 82.75 Β±1.63 / 84.73 ms β +1.14x faster β β QQuery 6 β18.56 / 18.93 Β±0.34 / 19.56 ms β 18.63 / 18.70 Β±0.08 / 18.82 ms β no change β β QQuery 7 β 98.95 / 100.45 Β±1.11 / 102.15 ms β 91.26 / 93.07 Β±1.59 / 95.64 ms β +1.08x faster β β QQuery 8 β85.77 / 88.52 Β±1.76 / 90.44 ms β 82.57 / 86.41 Β±2.05 / 88.31 ms β no change β β QQuery 9 β93.11 / 95.46 Β±1.77 / 97.54 ms β 89.31 / 91.54 Β±1.72 / 93.97 ms β no change β β QQuery 10 β71.08 / 71.34 Β±0.21 / 71.68 ms β 69.75 / 71.35 Β±1.00 / 72.83 ms β no change β β QQuery 11 β22.55 / 23.32 Β±0.59 / 24.11 ms β 22.64 / 23.58 Β±0.65 / 24.54 ms β no change β β QQuery 12 β47.75 / 48.85 Β±0.79 / 50.12 ms β 44.97 / 45.76 Β±0.71 / 46.70 ms β +1.07x faster β β QQuery 13 β49.21 / 51.38 Β±1.46 / 53.24 ms β 48.52 / 49.31 Β±0.64 / 50.08 ms β no chang
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459984918 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4459959221) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4459959221-126-t7kg9 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459984922 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4372819392) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4372819392-128-d2ss9 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpcds Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459984039 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373801306-132-ccmhc 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459984462 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4382478164) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4382478164-137-dtcx6 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459984754 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373801306-131-p7g7s 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpcds Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459983529 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4381836993) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4381836993-138-8kltt 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459982785 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4376856575) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4376856575-136-7grmr 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459982731 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4385430919) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4385430919-139-x9tds 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459982753 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4372819392) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4372819392-129-h2x5d 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459982386 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4372819392) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4372819392-127-dmj2k 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: clickbench_partitioned Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459981369 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4386511709) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4386511709-141-fclmw 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459981431 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4385685216) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4385685216-140-vpzvf 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459981413 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373801306-130-6dvrj 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: clickbench_partitioned Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459981584 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4459957969) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4459957969-125-mbtts 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (83c31ec07d96061412268cdfff81596cd39b5b7f) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..83c31ec07d96061412268cdfff81596cd39b5b7f) using: clickbench_partitioned Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459959221 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 256 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4459957969 run benchmark clickbench_partitioned -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3244079268
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010: URL: https://github.com/apache/datafusion/pull/22010#discussion_r3244065194 ## Cargo.lock: ## @@ -1528,6 +1528,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] Review Comment: Reverted the commit for now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010: URL: https://github.com/apache/datafusion/pull/22010#discussion_r3244059070 ## Cargo.lock: ## @@ -1528,6 +1528,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] Review Comment: I don't think we can no, that package contains a work stealing queue, which is not really what we need here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on code in PR #22010: URL: https://github.com/apache/datafusion/pull/22010#discussion_r3243893739 ## Cargo.lock: ## @@ -1528,6 +1528,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] Review Comment: not a huge fan of this new dependency --given we already have https://crates.io/crates/crossbeam-deque (a few lines above) maybe we can just that one so there are no net new dependencies? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3243879370
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatchCoa
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3243602400
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3242587386
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4451670111 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4451463424) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 358.90 / 361.46 Β±2.95 / 365.76 ms β 356.63 / 360.12 Β±2.89 / 364.76 ms β no change β β QQuery 2 β 989.31 / 1039.41 Β±36.99 / 1085.24 ms β 905.77 / 942.25 Β±21.92 / 970.61 ms β +1.10x faster β β QQuery 3 β 1445.20 / 1486.99 Β±47.26 / 1579.03 ms β 1082.15 / 1100.26 Β±11.03 / 1115.34 ms β +1.35x faster β β QQuery 4 β 714.31 / 725.62 Β±9.99 / 738.10 ms β 481.91 / 486.67 Β±3.13 / 490.66 ms β +1.49x faster β β QQuery 5 β 1794.56 / 1818.08 Β±18.23 / 1845.93 ms β 1273.82 / 1299.79 Β±29.54 / 1355.64 ms β +1.40x faster β β QQuery 6 β 137.19 / 144.45 Β±9.40 / 162.93 ms β 136.72 / 138.40 Β±1.36 / 140.87 ms β no change β β QQuery 7 β 2003.39 / 2056.18 Β±28.11 / 2084.59 ms β 1509.25 / 1551.20 Β±25.59 / 1589.70 ms β +1.33x faster β β QQuery 8 β 2316.71 / 2356.48 Β±39.96 / 2427.18 ms β 1790.74 / 1810.09 Β±25.17 / 1858.29 ms β +1.30x faster β β QQuery 9 β 2526.10 / 2560.80 Β±35.88 / 2624.32 ms β 1791.95 / 1809.58 Β±16.56 / 1837.60 ms β +1.42x faster β β QQuery 10 β 1148.14 / 1225.32 Β±68.13 / 1351.64 ms β 1048.13 / 1072.64 Β±22.65 / .66 ms β +1.14x faster β β QQuery 11 β692.31 / 736.06 Β±45.23 / 791.83 ms β 599.96 / 625.28 Β±17.75 / 642.33 ms β +1.18x faster β β QQuery 12 β624.38 / 638.64 Β±15.16 / 664.10 ms β 561.23 / 576.42 Β±13.27 / 596.57 ms β +1.11x faster β β QQuery 13 β614.37 / 637.91 Β±16.36 / 658.38 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4451491866 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4451463424) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4451463424-88-fbs47 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (bbd10de9f01161639957ae1c090752158404116d) to 4fac70d (merge-base) [diff](https://github.com/apache/datafusion/compare/4fac70d9b274138b89fef8fce80dcafa378f5891..bbd10de9f01161639957ae1c090752158404116d) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4451463424 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 256 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3241695978
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4450871828 Moving it temporarily to draft, I want to improve it a bit more before it's ready for another review. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3237516331
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
Review Comment:
Manage to come up with
https://github.com/apache/datafusion/pull/22010/changes/bab26b7c584b4fe4109ee4442904643a25804f33.
There's several places in this file where partition->channel maps are
represented with `HashMap` instead of `Vec<_>`. Rather than moving
only this one to be a `Vec<_>` I tried to be consistent in the other places and
now they are all `Vec<_>`s.
This cascaded into a bunch of restructures that I think have a net positive
outcome, as it allowed to remove yet another abstraction (`struct
OutputChannels`) and simplify a bit the code, and now the diff is even smaller.
Let me know what you think.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3237494012
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -1055,6 +1247,7 @@ impl ExecutionPlan for RepartitionExec {
let name = self.name().to_owned();
let schema = self.schema();
let schema_captured = Arc::clone(&schema);
+let fetch = self.fetch();
Review Comment:
Done in
https://github.com/apache/datafusion/pull/22010/changes/675cc4b6c2edc4174715e539a5425675cdd18461
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3237444229
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -1055,6 +1247,7 @@ impl ExecutionPlan for RepartitionExec {
let name = self.name().to_owned();
let schema = self.schema();
let schema_captured = Arc::clone(&schema);
+let fetch = self.fetch();
Review Comment:
π€ Interesting, you are completely right, I was getting confused because of
the fact that `LimitedBatchCoalescer` is used here, but it looks like `None` is
passed in every case, so we might be better without it at all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3237422234
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
Review Comment:
π€ thinking about it, it's probably possible to structure things so that this
never happens. I'll try it out.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3237098214
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3237020075
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
Review Comment:
I think this is how it worked before:
https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/repartition/mod.rs#L1778-L1814
Before, the batches were getting coalesced later in the `RepartitionExec`
pipeline, and there was no memory accounting happening there, so I'd expect the
memory reservation to behave the same as `main`.
Not implying that's the best approach though... as I invest time in
improving this operator, I find it a bit hard to deal with, as it seems to have
accumulated several stacked abstractions (structs representing things) over the
years, and it's a bit hard to maintain.
I'd not be surprised if a full rewrite could yield a more maintainable
outcome.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3236951720
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatc
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3236281180
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
Review Comment:
The reason why this is a `HashMap` is mainly because
that's what it was before this PR. Note how that did not change:
https://github.com/apache/datafusion/blob/dcf648255b92a34798871139aeba12d95f8f3032/datafusion/physical-plan/src/repartition/mod.rs#L559-L576
I'll try refactoring further and using `Vec` instead
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4442338874 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4442066583) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark clickbench_partitioned.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 0 β 1.23 / 4.65 Β±6.73 / 18.12 ms β 1.21 / 4.65 Β±6.76 / 18.17 ms β no change β β QQuery 1 β13.24 / 13.57 Β±0.19 / 13.76 ms β 12.25 / 12.78 Β±0.29 / 13.09 ms β +1.06x faster β β QQuery 2 β37.23 / 37.55 Β±0.27 / 37.88 ms β 36.91 / 37.27 Β±0.27 / 37.72 ms β no change β β QQuery 3 β32.01 / 33.18 Β±1.25 / 35.60 ms β 31.92 / 32.09 Β±0.15 / 32.38 ms β no change β β QQuery 4 β 238.77 / 240.39 Β±1.07 / 241.50 ms β 224.84 / 232.44 Β±4.83 / 239.02 ms β no change β β QQuery 5 β 283.27 / 286.11 Β±1.84 / 288.51 ms β 277.81 / 281.77 Β±2.86 / 286.57 ms β no change β β QQuery 6 β 7.18 / 7.56 Β±0.22 / 7.83 ms β 7.28 / 7.65 Β±0.34 / 8.30 ms β no change β β QQuery 7 β14.81 / 15.71 Β±1.60 / 18.91 ms β 13.61 / 13.70 Β±0.06 / 13.79 ms β +1.15x faster β β QQuery 8 β 324.07 / 330.32 Β±4.09 / 336.51 ms β 313.10 / 316.33 Β±3.51 / 322.47 ms β no change β β QQuery 9 β 449.61 / 466.99 Β±9.36 / 476.87 ms β 454.36 / 467.18 Β±11.16 / 483.83 ms β no change β β QQuery 10 β74.53 / 75.36 Β±0.86 / 76.94 ms β 74.76 / 75.47 Β±0.63 / 76.63 ms β no change β β QQuery 11 β86.60 / 87.23 Β±0.38 / 87.65 ms β 85.41 / 86.85 Β±1.22 / 88.87 ms β no change β β QQuery 12 β 277.64 / 282.47 Β±4.52 / 291.0
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3235263825
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
+for partition in partitions {
+let Some(channel) = self.inner.get(&partition) else {
+continue;
+};
+let Some(shared) = channel.shared_coalescer.clone() else {
+continue;
+};
+for batch in shared.finalize()? {
+self.send_to_channel(partition, batch).await;
+}
+}
+Ok(())
+}
+
+/// Send a single batch through the channel for `partition`, applying
+/// the memory reservation / spill-writer fallback. Removes the channel
+/// from `self.inner` if the receiver has hung up.
+async fn send_to_channel(&mut self, partition: usize, batch: RecordBatch) {
+let size = batch.get_array_memory_size();
+let timer = self.metrics.send_time[partition].timer();
+
+// Decide the payload outside of any await: never hold a MutexGuard
+// across an await point.
+let (payload, is_memory_batch) = {
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+match channel.reservation.try_grow(size) {
+Ok(_) => (Ok(RepartitionBatch::Memory(batch)), true),
+Err(_) => match channel.spill_writer.push_batch(&batch) {
+Ok(()) => (Ok(RepartitionBatch::Spilled), false),
+Err(err) => (Err(err), false),
+},
+}
+};
+
+let Some(channel) = self.inner.get(&partition) else {
+timer.done();
+return;
+};
+let send_err = channel.sender.send(Some(payload)).await.is_err();
+if send_err {
+if is_memory_batch && let Some(channel) =
self.inner.get(&partition) {
+channel.reservation.shrink(size);
+}
+self.inner.remove(&partition);
+}
+timer.done();
+}
+}
+
+/// A producer-side coalescer shared across all input tasks targeting a
+/// single output partition.
+///
+/// Bundles the [`LimitedBatchCoalescer`] (behind a [`Mutex`]) with the
+/// active-sender counter that tracks how many input tasks may still push
+/// into it. The last task to call [`Self::finalize`] is the one that
+/// finalizes the coalescer and ships the residual batch.
+///
+/// Cheap to [`Clone`]: both fields are [`Arc`]s.
+#[derive(Clone)]
+struct SharedCoalescer {
+inner: Arc>,
+active_senders: Arc,
+}
+
+impl SharedCoalescer {
+fn new(
+schema: SchemaRef,
+target_batch_size: usize,
+fetch: Option,
+num_senders: usize,
+) -> Self {
+Self {
+inner: Arc::new(Mutex::new(LimitedBatchCoa
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3235171117
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+let partitions: Vec = self.inner.keys().copied().collect();
Review Comment:
I wonder if we could avoid this copy/ allocation and just consume the inner
```rust
async fn finalize(&mut self) -> Result<()> {
for (partition, channel) in self.inner.drain() {
let Some(shared) = channel.shared_coalescer.clone() else {
continue;
};
for batch in shared.finalize()? {
self.send_to_channel(partition, batch).await;
}
}
Ok(())
}
```
it would probably require rejiggering how `self.send_to_channel` worked to
get a passed channel (rather than looking it up again)
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
+metrics: RepartitionMetrics,
+}
+
+impl OutputChannels {
+fn new(inner: HashMap, metrics: RepartitionMetrics)
-> Self {
+Self { inner, metrics }
+}
+
+fn is_empty(&self) -> bool {
+self.inner.is_empty()
+}
+
+fn metrics(&self) -> &RepartitionMetrics {
+&self.metrics
+}
+
+/// Push `batch` for `partition` through its shared coalescer (if any)
+/// and ship any newly completed batches through the channel.
+async fn coalesce_and_send(
+&mut self,
+partition: usize,
+batch: RecordBatch,
+) -> Result<()> {
+let Some(channel) = self.inner.get(&partition) else {
+return Ok(());
+};
+let to_send = match &channel.shared_coalescer {
+Some(shared) => shared.push_and_drain(batch)?,
+None => vec![batch],
+};
+for batch in to_send {
+self.send_to_channel(partition, batch).await;
+}
+Ok(())
+}
+
+/// For each output partition this task still has, decrement the shared
+/// active-senders counter. The last task to do so calls
+/// [`SharedCoalescer::finalize`] and ships the residual.
+async fn finalize(&mut self) -> Result<()> {
+
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4442114895 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4442066583) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4442066583-33-jr8fx 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: clickbench_partitioned Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4442066583 run benchmark clickbench_partitioned -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
alamb commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4401153807 Checking this one out -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4386672734 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4386511709) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 367.06 / 376.49 Β±5.20 / 382.52 ms β 372.31 / 375.69 Β±3.13 / 380.99 ms β no change β β QQuery 2 β 1260.81 / 1297.89 Β±24.76 / 1328.98 ms β 1088.61 / 1148.21 Β±35.65 / 1185.95 ms β +1.13x faster β β QQuery 3 β 1744.15 / 1806.38 Β±43.72 / 1852.32 ms β 1251.02 / 1289.81 Β±32.00 / 1324.73 ms β +1.40x faster β β QQuery 4 β888.76 / 906.97 Β±12.79 / 922.98 ms β 553.87 / 568.43 Β±18.86 / 605.40 ms β +1.60x faster β β QQuery 5 β 2132.02 / 2158.75 Β±18.28 / 2182.62 ms β 1446.96 / 1511.02 Β±46.98 / 1585.61 ms β +1.43x faster β β QQuery 6 β 144.88 / 147.65 Β±1.69 / 149.89 ms β 144.11 / 145.79 Β±1.26 / 147.54 ms β no change β β QQuery 7 β 2409.54 / 2450.25 Β±26.23 / 2490.30 ms β 1798.17 / 1803.17 Β±4.45 / 1811.21 ms β +1.36x faster β β QQuery 8 β 2691.89 / 2740.83 Β±40.78 / 2802.86 ms β 2044.77 / 2084.19 Β±43.95 / 2163.09 ms β +1.32x faster β β QQuery 9 β 2885.59 / 2926.05 Β±54.13 / 3031.23 ms β 1965.90 / 2044.98 Β±64.14 / 2160.93 ms β +1.43x faster β β QQuery 10 β 1453.06 / 1496.26 Β±32.16 / 1545.21 ms β 1319.83 / 1351.71 Β±19.46 / 1378.89 ms β +1.11x faster β β QQuery 11 β 960.02 / 976.94 Β±24.66 / 1025.09 ms β 811.60 / 870.93 Β±45.87 / 946.23 ms β +1.12x faster β β QQuery 12 β751.15 / 787.85 Β±39.31 / 845.59 ms β 671.76 / 777.48 Β±55.25 / 823.24 ms β no change β β QQuery 13 β735.67 / 764.15 Β±24.27 / 796.35 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4386547989 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4386511709) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4386511709-2040-qx5k4 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4386511709 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 300 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4386367667 > @gabotechs I notice peak memory is quite a bit higher here? I can imagine how this can happen in cases where the fanout is very big, it boils down to the gating mechanism implemented in `RepartitionExec` today: https://github.com/apache/datafusion/blob/dcf648255b92a34798871139aeba12d95f8f3032/datafusion/physical-plan/src/repartition/distributor_channels.rs#L21-L36 Before this PR, the batches that were flowing through there where of size `batch_size / output_partitions`, but with this PR, they are of size `batch_size`. The memory reporting there seems quite unstable though, for example, this other runs show the same peak memory usage: - https://github.com/apache/datafusion/pull/22010#issuecomment-4374065644 - https://github.com/apache/datafusion/pull/22010#issuecomment-4374088542 - https://github.com/apache/datafusion/pull/22010#issuecomment-4374117175 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4386270831 https://github.com/user-attachments/assets/334249df-0f2b-437e-aecc-dbd0b5f389e4"; /> @gabotechs I notice peak memory is quite a bit higher here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4386266755 https://github.com/user-attachments/assets/b2e90d85-8981-49cf-8d60-81eaa50c9cd1"; /> From: Apache Arrow DataFusion: a Fast, Embeddable, Modular Analytic Query Engine https://andrew.nerdnetworks.org/pdf/SIGMOD-2024-lamb.pdf I think there is some overlap of these 2024 figures at high core counts (>32 cores) and the reported improvements here. @alamb @gabotechs perhaps it would be good to redo this experiment once more. With morsel scan + optimization like this I expect this picture to look much better for the higher core counts :) Perhaps we could also test clickbench just on higher core counts and see if it improves. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385792780 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4385685216) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 374.98 / 377.69 Β±1.62 / 379.48 ms β 373.97 / 376.74 Β±1.91 / 379.20 ms β no change β β QQuery 2 β 1267.60 / 1325.63 Β±39.16 / 1373.05 ms β 1131.50 / 1173.97 Β±25.78 / 1200.53 ms β +1.13x faster β β QQuery 3 β 1797.16 / 1825.13 Β±19.25 / 1853.48 ms β 1288.02 / 1318.33 Β±18.11 / 1340.33 ms β +1.38x faster β β QQuery 4 β863.53 / 886.46 Β±20.46 / 916.70 ms β 558.94 / 598.42 Β±32.75 / 637.74 ms β +1.48x faster β β QQuery 5 β 2114.70 / 2133.66 Β±14.97 / 2157.96 ms β 1426.81 / 1496.98 Β±48.79 / 1576.25 ms β +1.43x faster β β QQuery 6 β 144.35 / 150.47 Β±5.81 / 160.89 ms β 141.61 / 146.18 Β±6.00 / 158.02 ms β no change β β QQuery 7 β 2426.03 / 2473.60 Β±34.41 / 2518.15 ms β 1798.66 / 1829.02 Β±27.81 / 1878.56 ms β +1.35x faster β β QQuery 8 β 2711.55 / 2777.09 Β±65.27 / 2889.80 ms β 2062.51 / 2130.00 Β±46.43 / 2182.96 ms β +1.30x faster β β QQuery 9 β 2896.73 / 2960.38 Β±43.61 / 3032.65 ms β 1984.24 / 2041.10 Β±34.27 / 2074.79 ms β +1.45x faster β β QQuery 10 β 1477.16 / 1501.84 Β±26.36 / 1552.01 ms β 1285.89 / 1341.81 Β±35.92 / 1397.85 ms β +1.12x faster β β QQuery 11 β 1001.36 / 1032.84 Β±29.06 / 1077.74 ms β 804.14 / 841.48 Β±33.50 / 903.26 ms β +1.23x faster β β QQuery 12 β777.00 / 797.55 Β±27.06 / 850.98 ms β 758.30 / 795.39 Β±27.36 / 839.63 ms β no change β β QQuery 13 β749.25 / 775.51 Β±30.41 / 829.85 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385698232 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4385685216) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4385685216-2038-cjdr7 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385691293 Hi @Dandandan, you asked to view the benchmark queue (https://github.com/apache/datafusion/pull/22010#issuecomment-4385691249). | Comment | Repo | PR | User | Benchmarks | Status | | --- | --- | --- | --- | --- | --- | | [#4385685216](https://github.com/apache/datafusion/pull/22010#issuecomment-4385685216) | apache/datafusion | #22010 | Dandandan | ["tpch10"] | running | --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385691249 show benchmark queue -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385690610 I am wondering why the benchmarks aren't completing anymore with the high target partition. Is it a deadlock or something else? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385685216 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 300 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385441576 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4385430919) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4385430919-2037-6jqdl 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4385430919 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 512 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4382498372 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4382478164) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4382478164-2031-w9s9p 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4382478164 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 512 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4381857196 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4381836993) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4381836993-2030-67qvv 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4381836993 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 2048 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4377007472 Ok, as it looks like it does what was intended, I'll open this for review and improve the PR description. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Samyak2 commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4377001173 This should fix https://github.com/apache/datafusion/issues/20491 too! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4376934736 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4376856575) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf10.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β 367.67 / 370.56 Β±2.75 / 374.78 ms β 365.18 / 373.67 Β±4.77 / 379.99 ms β no change β β QQuery 2 β 1004.79 / 1044.73 Β±25.91 / 1077.76 ms β 911.89 / 929.35 Β±13.91 / 949.82 ms β +1.12x faster β β QQuery 3 β 1449.50 / 1482.28 Β±26.02 / 1515.45 ms β 1020.76 / 1037.48 Β±17.38 / 1068.95 ms β +1.43x faster β β QQuery 4 β723.52 / 737.25 Β±10.02 / 751.24 ms β 434.60 / 469.21 Β±19.98 / 496.75 ms β +1.57x faster β β QQuery 5 β 1761.69 / 1789.09 Β±27.18 / 1828.80 ms β 1226.71 / 1252.80 Β±14.01 / 1265.94 ms β +1.43x faster β β QQuery 6 β 144.57 / 145.98 Β±2.30 / 150.51 ms β 143.31 / 143.63 Β±0.25 / 143.98 ms β no change β β QQuery 7 β 1974.80 / 2092.05 Β±68.11 / 2169.52 ms β 1449.65 / 1485.49 Β±25.19 / 1515.01 ms β +1.41x faster β β QQuery 8 β 2244.63 / 2306.15 Β±35.70 / 2345.41 ms β 1728.81 / 1790.63 Β±34.56 / 1828.12 ms β +1.29x faster β β QQuery 9 β 2464.34 / 2498.28 Β±19.34 / 2518.71 ms β 1684.52 / 1727.57 Β±52.17 / 1821.02 ms β +1.45x faster β β QQuery 10 β 1178.65 / 1188.35 Β±7.41 / 1199.86 ms β 1032.39 / 1063.70 Β±28.55 / 1108.34 ms β +1.12x faster β β QQuery 11 β702.30 / 724.13 Β±17.12 / 746.29 ms β 592.85 / 617.01 Β±24.95 / 657.93 ms β +1.17x faster β β QQuery 12 β625.06 / 645.32 Β±16.86 / 664.50 ms β 570.42 / 586.23 Β±19.29 / 621.02 ms β +1.10x faster β β QQuery 13 β603.10 / 632.75 Β±15.98 / 651.15 ms β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4376873421 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4376856575) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4376856575-2023-d9wvg 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch10 Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on code in PR #22010:
URL: https://github.com/apache/datafusion/pull/22010#discussion_r3186325722
##
datafusion/physical-plan/src/repartition/mod.rs:
##
@@ -143,11 +144,183 @@ type MaybeBatch = Option>;
type InputPartitionsToCurrentPartitionSender =
Vec>;
type InputPartitionsToCurrentPartitionReceiver =
Vec>;
-/// Output channel with its associated memory reservation and spill writer
+/// One input task's collection of output channels (its send-side view of
+/// every output partition). Owns the per-call helpers for coalescing,
+/// finalizing, and sending.
+///
+/// This complements [`PartitionChannels`] (the per-output-partition,
+/// authoritative struct that owns `rx`, `spill_readers`, and the underlying
+/// `Mutex` / `AtomicUsize`). Each [`OutputChannel`]
+/// inside `inner` holds cloned `Arc`s pointing back at those shared
+/// resources.
+struct OutputChannels {
+inner: HashMap,
Review Comment:
Probably no perf change but I think `Vec>` is better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
Dandandan commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4376856575 run benchmark tpch10 ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 256 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4374117175 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpcds_sf1.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β59.89 / 60.88 Β±0.72 / 62.06 ms β 57.67 / 58.72 Β±0.65 / 59.66 ms β no change β β QQuery 2 β 287.90 / 294.59 Β±7.63 / 309.50 ms β 293.62 / 298.18 Β±3.69 / 302.38 ms β no change β β QQuery 3 β 153.80 / 159.23 Β±4.70 / 166.20 ms β 152.32 / 158.94 Β±4.31 / 163.80 ms β no change β β QQuery 4 β 1584.03 / 1634.24 Β±32.13 / 1675.55 ms β 1577.42 / 1608.11 Β±39.11 / 1679.48 ms β no change β β QQuery 5 β629.67 / 645.17 Β±12.01 / 664.54 ms β 622.07 / 671.39 Β±29.87 / 705.61 ms β no change β β QQuery 6 β270.48 / 279.48 Β±11.42 / 301.90 ms β 270.68 / 278.75 Β±5.46 / 284.94 ms β no change β β QQuery 7 β 1226.87 / 1237.03 Β±9.32 / 1252.20 ms β 1221.31 / 1254.15 Β±25.33 / 1294.88 ms β no change β β QQuery 8 β 221.33 / 228.10 Β±4.98 / 236.47 ms β 208.70 / 220.59 Β±6.84 / 229.31 ms β no change β β QQuery 9 β276.35 / 289.40 Β±12.16 / 310.43 ms β 268.77 / 288.58 Β±21.61 / 330.69 ms β no change β β QQuery 10 β 170.87 / 172.98 Β±2.50 / 177.70 ms β 158.84 / 170.55 Β±6.10 / 176.61 ms β no change β β QQuery 11 β .47 / 1144.32 Β±38.99 / 1197.94 ms β 1089.10 / 1132.32 Β±40.07 / 1188.62 ms β no change β β QQuery 12 β 114.87 / 117.21 Β±1.80 / 119.88 ms β 115.88 / 120.01 Β±4.10 / 126.97 ms β no change β
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4374088542 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark clickbench_partitioned.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 0 β 1.56 / 5.11 Β±6.88 / 18.87 ms β 1.68 / 5.20 Β±6.84 / 18.88 ms β no change β β QQuery 1 β23.35 / 25.87 Β±1.81 / 28.40 ms β 23.59 / 25.94 Β±1.43 / 27.78 ms β no change β β QQuery 2 β49.25 / 51.11 Β±1.24 / 52.88 ms β 49.29 / 49.91 Β±0.58 / 50.75 ms β no change β β QQuery 3 β39.42 / 41.33 Β±1.66 / 43.82 ms β 40.68 / 42.23 Β±1.93 / 46.00 ms β no change β β QQuery 4 β 365.86 / 373.34 Β±3.93 / 377.23 ms β 259.15 / 274.15 Β±9.58 / 285.94 ms β +1.36x faster β β QQuery 5 β 397.96 / 403.97 Β±7.19 / 417.98 ms β 335.46 / 338.66 Β±2.94 / 342.29 ms β +1.19x faster β β QQuery 6 β22.21 / 23.65 Β±0.83 / 24.65 ms β 22.59 / 23.81 Β±1.30 / 26.25 ms β no change β β QQuery 7 β55.15 / 55.83 Β±0.70 / 57.07 ms β 53.34 / 54.65 Β±0.78 / 55.40 ms β no change β β QQuery 8 β 521.18 / 523.30 Β±2.43 / 526.99 ms β 361.02 / 367.67 Β±8.02 / 383.16 ms β +1.42x faster β β QQuery 9 β 407.52 / 412.56 Β±5.12 / 422.37 ms β 414.74 / 434.76 Β±14.19 / 453.97 ms β 1.05x slower β β QQuery 10 β 149.19 / 154.10 Β±4.25 / 159.92 ms β 147.57 / 149.96 Β±1.52 / 151.64 ms β no change β β QQuery 11 β 167.96 / 171.41 Β±2.75 / 175.08 ms β 161.24 / 165.93 Β±4.23 / 172.86 ms β no change β β QQuery 12 β 405.92 / 408.13 Β±2.45 / 412.7
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4374065644 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpch_sf1.json βββββ³β³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘βββββββββββ© β QQuery 1 β 81.08 / 84.06 Β±1.65 / 85.99 ms β 80.95 / 83.92 Β±1.91 / 86.82 ms β no change β β QQuery 2 β 77.40 / 83.16 Β±3.41 / 86.29 ms β 82.28 / 84.42 Β±1.29 / 85.65 ms β no change β β QQuery 3 β 380.72 / 404.84 Β±21.00 / 439.20 ms β 339.05 / 361.13 Β±19.01 / 395.26 ms β +1.12x faster β β QQuery 4 β 62.13 / 69.48 Β±4.55 / 74.12 ms β 67.85 / 68.46 Β±0.54 / 69.47 ms β no change β β QQuery 5 β 641.00 / 692.54 Β±34.21 / 734.60 ms β 601.13 / 625.35 Β±16.84 / 645.13 ms β +1.11x faster β β QQuery 6 β 28.95 / 33.50 Β±3.18 / 37.56 ms β 28.30 / 29.87 Β±1.28 / 32.15 ms β +1.12x faster β β QQuery 7 β 656.49 / 677.65 Β±16.14 / 703.51 ms β 616.89 / 648.76 Β±25.71 / 685.81 ms β no change β β QQuery 8 β 633.58 / 665.74 Β±23.16 / 699.52 ms β 621.61 / 658.45 Β±31.18 / 697.94 ms β no change β β QQuery 9 β 608.61 / 638.65 Β±20.63 / 669.90 ms β 577.22 / 594.91 Β±16.49 / 626.07 ms β +1.07x faster β β QQuery 10 β 119.28 / 128.39 Β±6.38 / 138.74 ms β 112.93 / 120.19 Β±4.76 / 125.52 ms β +1.07x faster β β QQuery 11 β 82.81 / 86.38 Β±2.59 / 89.26 ms β 78.55 / 85.89 Β±3.91 / 89.20 ms β no change β β QQuery 12 β 661.09 / 685.12 Β±16.92 / 711.09 ms β 667.52 / 689.34 Β±15.81 / 711.68 ms β no change β β QQuery 13 β 291.07 / 328.78 Β±23.90 / 350.88 ms β 287.39 / 315.76 Β±19.41 / 343.61 m
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4373999348 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373980023-2021-bkfjb 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpch Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4373997621 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373980023-2020-4g4qq 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: tpcds Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4373993504 π€ Benchmark running (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) | `Linux bench-c4373980023-2019-qhxhm 6.12.68+ #1 SMP Wed Apr 1 02:23:28 UTC 2026 aarch64 GNU/Linux` CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Comparing gabotechs/repartition-coalesce-batches-berfore-channels (dcf648255b92a34798871139aeba12d95f8f3032) to b2fd2d3 (merge-base) [diff](https://github.com/apache/datafusion/compare/b2fd2d32b053f15632b9fa6941b363d67fd6844e..dcf648255b92a34798871139aeba12d95f8f3032) using: clickbench_partitioned Results will be posted here when complete --- [File an issue](https://github.com/adriangb/datafusion-benchmarking/issues) against this benchmark runner -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
gabotechs commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4373980023 run benchmarks ``` env: DATAFUSION_EXECUTION_TARGET_PARTITIONS: 256 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] perf: coalesce batches before sending to distributor channels in RepartitionExec [datafusion]
adriangbot commented on PR #22010: URL: https://github.com/apache/datafusion/pull/22010#issuecomment-4373927206 π€ Benchmark completed (GKE) | [trigger](https://github.com/apache/datafusion/pull/22010#issuecomment-4373801306) **Instance:** `c4a-highmem-16` (12 vCPU / 65 GiB) CPU Details (lscpu) ``` Architecture:aarch64 CPU op-mode(s): 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: ARM Model name: Neoverse-V2 Model: 1 Thread(s) per core: 1 Core(s) per cluster: 16 Socket(s): - Cluster(s): 1 Stepping:r0p1 BogoMIPS:2000.00 Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh rng bti L1d cache: 1 MiB (16 instances) L1i cache: 1 MiB (16 instances) L2 cache:32 MiB (16 instances) L3 cache:80 MiB (1 instance) NUMA node(s):1 NUMA node0 CPU(s): 0-15 Vulnerability Gather data sampling: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling:Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1:Mitigation; __user pointer sanitization Vulnerability Spectre v2:Mitigation; CSV2, BHB Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Not affected ``` Details ``` Comparing HEAD and gabotechs_repartition-coalesce-batches-berfore-channels Benchmark tpcds_sf1.json βββββ³ββββ³ββ³ββββ β Query β HEAD β gabotechs_repartition-coalesce-batches-berfore-channels βChange β β‘ββββββββββββββ© β QQuery 1 β13.79 / 14.18 Β±0.65 / 15.46 ms β 13.72 / 14.19 Β±0.69 / 15.57 ms β no change β β QQuery 2 β 159.22 / 160.09 Β±0.61 / 160.74 ms β 160.90 / 162.32 Β±0.82 / 163.14 ms β no change β β QQuery 3 β 117.84 / 119.51 Β±1.38 / 121.35 ms β 117.74 / 118.88 Β±0.88 / 120.37 ms β no change β β QQuery 4 β 1318.19 / 1375.95 Β±62.45 / 1477.81 ms β 1342.78 / 1411.19 Β±50.60 / 1498.56 ms β no change β β QQuery 5 β 202.08 / 203.76 Β±1.18 / 205.00 ms β 204.12 / 205.77 Β±1.54 / 207.72 ms β no change β β QQuery 6 β 139.79 / 141.55 Β±2.63 / 146.77 ms β 144.42 / 145.12 Β±1.05 / 147.20 ms β no change β β QQuery 7 β 414.19 / 418.61 Β±4.50 / 427.00 ms β 430.53 / 433.52 Β±2.82 / 438.10 ms β no change β β QQuery 8 β 120.58 / 121.74 Β±0.81 / 122.95 ms β 122.07 / 123.38 Β±1.53 / 126.34 ms β no change β β QQuery 9 β 124.62 / 136.64 Β±8.09 / 148.23 ms β 126.56 / 135.82 Β±7.00 / 143.82 ms β no change β β QQuery 10 β 112.02 / 112.72 Β±0.57 / 113.50 ms β 110.68 / 113.28 Β±2.98 / 118.65 ms β no change β β QQuery 11 β 882.55 / 890.18 Β±7.52 / 903.32 ms β 905.46 / 984.28 Β±68.02 / 1092.79 ms β 1.11x slower β β QQuery 12 β48.04 / 49.41 Β±1.08 / 51.34 ms β 48.95 / 49.24 Β±0.22 / 49.58 ms β no change β
