Skip to content

optimize deltalake export memory - #241

Merged
fcollman merged 1 commit into
masterfrom
deltalake_mem_optimize
Aug 27, 2026
Merged

optimize deltalake export memory#241
fcollman merged 1 commit into
masterfrom
deltalake_mem_optimize

Conversation

@fcollman

Copy link
Copy Markdown
Collaborator

this addresses #237

  legacy new
single 512 MiB flush 3536 MiB (6.8x) 1836 MiB (3.6x)
8 sustained 512 MiB flushes 5340 MiB 3385 MiB
wall per flush 5.6 s 3.3 s

At a 512 MiB threshold that's ~3.4 GB against the 8 GB limit instead of ~5.3 GB.

shapely WKB decoding — 4.18x on its own. .to_list() built a Python bytes per row and shapely.from_wkb a GEOS geometry per row. Replaced with a numpy reader: PostGIS EWKB points are fixed-width, so the values buffer reshapes directly. Falls back to shapely for anything non-uniform (big-endian, 2D, mixed types).
Per-spec full-table copies. Each of your 4 specs materialised the whole table twice while the shared frame stayed alive. Now the derived columns attach to the decoded batches zero-copy.
The partitioned write — 3.93x. The writer holds an open Parquet writer per partition and flushes only when the call returns. Now written in bounded groups of partitions.
pl.cut materialised a string label per row (categorical→Utf8→Int32). Replaced with np.searchsorted.

@fcollman
fcollman merged commit dae2e34 into master Aug 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant