Repository navigation
perf(export): faster SQL and XLSX exports, row batches bounded by bytes - #4434
Merged
Merged
Conversation
… bytes, spill ClickHouse exports
…Kit in the iOS test
datlechin
enabled auto-merge (squash)
November 23, 2026 08:14
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
deliverSuspendingfor a producer that runs as a task, so a spent budget no longer blocks a thread of the cooperative pool.Measurements
Before is origin/main ab6f526, after is this branch, interleaved on the same Mac (M4, load 7 to 14). Harness rows: 1,000,000 rows shaped like
bench_typical, from memory through the export plugin built with-O.Generated:time differs)The stream rows come from
scripts/probes/check-stream-backpressure.shwith a 1 MiB payload and a 200 ms wait per batch. WithORDER BY idthe SQLite numbers are 379 and 335 MB, because SQLite's sorter holds the table before the first row comes out, whatever the stream does.Tests changed on purpose
XLSXWriterStreamingTests:workbookBytesAreUnchangedhashes the stored workbook rebuilt from the deflated entries, so the old digest still pins every byte of XML.sheetXMLReachesItsFileAsRowsArrivechecks the deflated part.oversizedWorkbookFailsEarlychecks the sheet's XML size.ExportStopAndStatusTests.xlsxStoppedDuringArchivewrites 320 cells of random base64, which does not deflate and fits Excel's cell limit, so the stop still lands mid-copy.XLSXWriterCellTypeTests,XLSXWriterSheetNameTests,ExportFormatRowScopeTestsandFormatSettingsChangedMidRunTestsread the workbook throughZipArchiveinstead of its raw bytes.ClickHouseStreamFailureTestsgains two cases with a held reader; the existing ones are unchanged.Deliberately not fixed here
QueryExecutor.swift, which the table-open-save lane changes next. Its own PR, after this one.SQLiteAgentBackendstill calls the blocking spill deliver from the cooperative pool. Its callback is synchronous, so it needs the agent connection's callback made async first.Test plan
verify.sh teston FormatPluginTests, SQLiteDriverTests, ClickHouseDriverTests, PostgreSQLDriverTests, MySQLDriverTests and the TableRows, masking and document export suites: 2,768 cases pass; FormatPluginTests again after the cell limit, 617 pass.verify.sh package TableProCorefor the quoting, PostgreSQL conformance, PluginKit parity, gzip and row stream suites: 67 and 19 pass.verify.sh pluginspasses. The iOS app and its tests build for testing (arm64); the iOS tests run on CI only.Docs: TableProApp/docs#273