Skip to content

perf(table): precompute data writer invariants - #1813

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/precompute-data-writer-invariants
Draft

perf(table): precompute data writer invariants#1813
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/precompute-data-writer-invariants

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What changed

  • Precompute the stats plan, current partition spec, Parquet row-group size, write properties, schema options, and file extension when the writer is created.
  • Reuse those values for every write task.
  • Add a focused writer benchmark.

Benchmark

Apple M1 Pro, GOMAXPROCS=1, median of 5 runs with -benchtime=1s:

  • origin/main: 8.53 us/op, 97 allocs/op, 6.49 KB/op
  • this branch: 6.38 us/op, 72 allocs/op, 5.01 KB/op
  • about 1.34x faster and 26% fewer allocations

The benchmark uses a no-op file format so it measures the per-task writer setup and schema conversion without filesystem or Parquet I/O.

Tests

  • go test ./...
  • go test -race ./table/...
  • go vet ./table/...

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