Skip to content

perf(table): format object-store hashes with a fixed buffer - #1814

Draft
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/fixed-buffer-object-store-hash-formatting
Draft

perf(table): format object-store hashes with a fixed buffer#1814
fallintoplace wants to merge 1 commit into
apache:mainfrom
fallintoplace:perf/fixed-buffer-object-store-hash-formatting

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Why

Object-store paths currently format the 20-bit Murmur3 hash by converting it to a binary string, slicing it into directories, and joining the pieces. This creates temporary allocations for every data file path.

What changed

  • Write the hash directly into a fixed-size buffer.
  • Keep the existing hash and directory layout unchanged.
  • Add a focused computeHash benchmark.

Benchmark

Apple M1 Pro, Go 1.26.3, GOMAXPROCS=1. Median of five 1-second runs:

ns/op B/op allocs/op
Before 1,422 112 3
After 646 24 1

The new version is about 2.2x faster.

Tests

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

@fallintoplace fallintoplace changed the title Table: fixed-buffer object-store hash formatting perf(table): format object-store hashes with a fixed buffer Aug 13, 2026
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