Skip to content

perf(export): MongoDB export documents, Parquet limits and unmeasured items left from #4434 #4444

Open

Description

@datlechin

Follow-up to #4434 (perf audit, export-data lane). Items left out of that PR:

  • M2, build MongoDB export documents only when exporting. Every MongoDB read builds them today (a third parse plus a BSON parse for the size, about 150 MB kept for 100k documents, est.). Not in perf(export): faster SQL and XLSX exports, row batches bounded by bytes #4434: it adds PluginQueryResult.documentPayloads and a static DriverPlugin.exportDocuments(from:) (PluginKit 47, additive) and touches QueryExecutor.swift, which the table-open-save lane changes next. Its own PR, after that lane.
  • M3, read MongoDB BSON once instead of five parses a document (1.31 M instructions a document, 44x a PostgreSQL row). Gated on a profile with a plugin dSYM, not run. Lands after M2.
  • E6, bound Parquet staging and COPY memory (Parquet export peaks at 496 MB). Gated on the command-line staging sweep (staging limit, COPY factor, threads, row group, 4 data shapes), not run. Only the 8 MiB staging batch from E4 landed. Dat said yes (D19).
  • M1 and E5 were not measured: no MongoDB registry harness or ClickHouse server on the MacBook. Proof: gaps.sh --only registry kept footprint for MongoDB, and a ClickHouse export of bench_typical with a slow reader. Gate is quiet pass 2.
  • E4 in the app: the PR measured the driver streams with check-stream-backpressure.sh (300 rows of 1 MiB, PostgreSQL 310 to 38 MB, SQLite 304 to 35 MB) but not gaps.sh --only ph08 on a Release build, and not MySQL (the local MariaDB takes only its socket). Gate is quiet pass 2.
  • SQL Server, Oracle and Cassandra still cut stream batches by rows only. The plan moves them to PluginRowBatcher when each driver is next touched.
  • SQLiteAgentBackend.swift calls the blocking PluginRowSpill.deliver from the cooperative pool. Needs the agent connection's row callback made async, then deliverSuspending.
  • A SQLite export of a query with ORDER BY on an unindexed column still holds the table in SQLite's sorter (379 MB before, 335 MB after for 300 rows of 1 MiB). Not the stream; check the vendored SQLite's temp store if it matters.
  • 16d, compact row storage (101 B a cell): not now, per Dat (D25).

Quiet pass 2 results will be added here.

Activity

  1. added
    enhancement
    platform-macos
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions