Skip to content

log: append-style formatter#20459

Merged
Giulio2002 merged 3 commits intomainfrom
alex/log_append_35
Apr 11, 2026
Merged

log: append-style formatter#20459
Giulio2002 merged 3 commits intomainfrom
alex/log_append_35

Conversation

@AskAlexSharov
Copy link
Copy Markdown
Collaborator

allocs 8 -> 6

Replace formatLogfmtValue/escapeString (which allocated intermediate
strings and used a sync.Pool) with append-style helpers that write
directly into the caller's buffer. Numeric/bool/time values use
strconv.Append* and AppendFormat instead of returning new strings.

Measured on BenchmarkLogfmtNoCtx:
  before: 8 allocs/op, 304 B/op
  after:  6 allocs/op, 264 B/op
@AskAlexSharov AskAlexSharov added this pull request to the merge queue Apr 10, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 10, 2026
@AskAlexSharov AskAlexSharov added this pull request to the merge queue Apr 10, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Apr 10, 2026
@Giulio2002 Giulio2002 enabled auto-merge April 10, 2026 18:06
@Giulio2002 Giulio2002 added this pull request to the merge queue Apr 11, 2026
Merged via the queue into main with commit 9f5504a Apr 11, 2026
35 checks passed
@Giulio2002 Giulio2002 deleted the alex/log_append_35 branch April 11, 2026 02:06
AskAlexSharov added a commit that referenced this pull request Apr 19, 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.

3 participants