Skip to content

Remove field-map copying from default request access logs - #4326

Merged
szuecs merged 3 commits into
zalando:masterfrom
perfloop-oss:perfloop-pr-open-3n1efmg97t
Oct 8, 2026
Merged

szuecs merged 3 commits into
zalando:masterfrom
perfloop-oss:perfloop-pr-open-3n1efmg97t

Conversation

@perfloop-agent

@perfloop-agent perfloop-agent commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Avoid building and copying field maps for default text access logs when no supplemental fields are present. Keep the existing Logrus emission path and field-based behavior for JSON, custom formatters, and supplemental fields.

Measurements

Ten paired runs per workload with BenchmarkAccessLogWithOutput:

Workload Before B/op After B/op Change
Inline 200, 10-byte body 18,115 15,410 -14.9%
Same with enableAccessLog(1, 200, 3) 19,779 17,075 -13.7%
Inline 418, 28-byte body 18,091 15,386 -15.0%
setQuery(lang, pt), local 12-byte backend 25,474 22,753 -10.7%
Redirect 308 16,691 13,970 -16.3%
Same after modPath 18,084 15,364 -15.0%

The benchmark measures complete Proxy.ServeHTTP calls with synchronous access-log writes to a regular file. Setup is outside the timed loop; the query backend is warmed. B/op includes response-recorder and loopback transport/backend allocations. Production traffic weights remain unmeasured. Each row requires at least 10% lower B/op with no ns/op or allocs/op regression.

Validation

Formatting, lint, logging/access-log tests, focused proxy tests, and logging/concurrent-access-log race checks passed.

TestAccessLogOnFailedRequest returns 407 instead of 502 and leaves two persistent-connection goroutines on both the baseline and this change; the cause is unresolved. Full repository CI remains pending. make shortcheck was not run because the Redis Testcontainers tests require Docker, which is unavailable in the sandbox.

Fixes #4325


Generated by Perfloop. Human sponsor: Tomás Senart.

Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Tomás Senart <ts@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Tomás Senart <ts@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Tomás Senart <ts@perfloop.ai>
@szuecs szuecs added optimization minor no risk changes, for example new filters labels Oct 8, 2026
@szuecs

szuecs commented Oct 8, 2026

Copy link
Copy Markdown
Member

👍

1 similar comment
@a4180p

a4180p commented Oct 8, 2026

Copy link
Copy Markdown
Member

👍

@szuecs
szuecs merged commit afd579d into zalando:master Oct 8, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor no risk changes, for example new filters optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid copying default access-log field maps per request

3 participants