Skip to content

fix(key): reduce String allocations - #522

Merged
linkdata merged 2 commits into
mainfrom
fix/key-string-allocation
Oct 2, 2026
Merged

linkdata merged 2 commits into
mainfrom
fix/key-string-allocation

Conversation

@linkdata

@linkdata linkdata commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Format nonzero keys directly with strconv.FormatUint, preserving the empty encoding for zero.
  • Add a retained Key.String benchmark.

Verification

  • Six benchmark samples compared with benchstat: 47% lower time, 50% fewer bytes and allocations per operation.
  • go test -race ./lib/key

Closes #498

@linkdata
linkdata merged commit 2add354 into main Oct 2, 2026
7 checks passed
@linkdata
linkdata deleted the fix/key-string-allocation branch October 2, 2026 14:07
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.

key: measure and reduce Key.String allocation

1 participant