Repository navigation
Use IPC instead of Elixir rows for table replication (15.9x faster) - #35
Merged
Merged
Conversation
When a computed %Dux{} (table ref) is distributed to workers, it was:
1. table_to_rows → Elixir list of maps
2. Sent as {:list, rows} in the pipeline struct
3. Workers re-ingested via rows_to_columns → ADBC ingest
Now uses the IPC path:
1. table_to_ipc → compact Arrow binary
2. Sent as {:ipc, binary} in the pipeline struct
3. Workers deserialize via zero-copy ADBC ingest
Added {:ipc, binary} as a source type in QueryBuilder. IPC table refs
are kept alive in the process dictionary during query execution and
cleaned up via clear_ipc_refs/0 in all worker query paths.
Benchmark (2 workers):
Replicate 1K rows: 16ms → 27ms (IPC overhead on small data, negligible)
Replicate 10K rows: 381ms → 24ms (15.9x faster)
Broadcast join: 260ms → 72ms (3.6x faster)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cigrainger
force-pushed
the
perf/ipc-table-replication
branch
from
March 25, 2026 01:45
c1dcdce to
829092b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a computed
%Dux{}(table ref) is distributed to workers, it was going through Elixir rows:table_to_rows→ list of maps (expensive materialization){:list, rows}in pipeline struct (large Erlang term)rows_to_columns→ ADBC (rebuild Arrow from scratch)Now uses Arrow IPC — the same binary format workers already use for results:
table_to_ipc→ compact Arrow binary{:ipc, binary}(binary copy, no term encoding)table_from_ipc→ zero-copy ADBC ingestChanges:
{:ipc, binary}source type inQueryBuilderPartitioner.replicate/2uses IPC instead of rowsShuffle.ensure_worker_safe/1uses IPC instead of rowsInspecthandles{:ipc, _}source displayBenchmark (2 local workers)
Test plan
🤖 Generated with Claude Code