Skip to content

perf(table): decode partition and sort fields once - #1823

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/partition-sort-json-one-pass
Draft

perf(table): decode partition and sort fields once#1823
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/partition-sort-json-one-pass

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Decode partition and sort field objects into one auxiliary value.
  • Preserve presence checks for source-id, source-ids, and transform.
  • Avoid the temporary raw map and second full-object decode.
  • Add single-source and multi-source benchmarks.

Benchmark

Apple M1 Pro, arm64:

Decoder Case Before After Result
Partition Single source 4,254 ns, 1,344 B, 30 allocs 2,168 ns, 976 B, 19 allocs 49% faster
Partition Multi source 4,467 ns, 1,408 B, 34 allocs 2,735 ns, 1,032 B, 23 allocs 39% faster
Sort Single source 3,508 ns, 1,360 B, 31 allocs 2,234 ns, 1,000 B, 20 allocs 36% faster
Sort Multi source 3,977 ns, 1,424 B, 35 allocs 2,627 ns, 1,048 B, 24 allocs 34% faster

Bytes and allocations drop by about 26% and 31 to 37%.

Tests

  • go test ./...
  • go vet .

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