Skip to content

perf(table): skip metadata builds when Transaction.apply has no new requirements - #1955

Open
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/skip-transaction-metadata-build
Open

perf(table): skip metadata builds when Transaction.apply has no new requirements#1955
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/skip-transaction-metadata-build

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • Lazy metadata builds: Transaction.apply now waits to build immutable metadata until a new requirement needs validation.
  • No-op requirement paths: Empty requirement lists and duplicate requirements skip MetadataBuilder.Build() while keeping conflict checks.
  • Atomic staging: The existing cloned builder and publish behavior stay unchanged.

Benchmark

Apple M1 Pro, Go 1.26.3, 10,000 snapshots:

  • No requirements: about 1.50 MB / 65 allocs to 1.21 MB / 14 allocs
  • Duplicate requirement: about 1.50 MB / 70 allocs to 1.21 MB / 19 allocs
  • New requirement: about 1.51 MB / 77 allocs before and after

Tests

  • go test -timeout=5m across all packages except io/gocloud
  • go test -race -timeout=5m . ./table/...
  • golangci-lint run --timeout=10m

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