Description
compiler_difc_proxy.go contains a proxyEnvVars() function that returns a 34-entry static map. Since the map never changes at runtime, it should be promoted to a package-level var (or const-like var). This removes the overhead of re-allocating the map on every call and improves readability by making the static nature explicit.
This was flagged in the Daily Compiler Code Quality report. The file otherwise scores 85/100 (Good) with excellent tests.
Suggested Changes
- Move the
proxyEnvVars() return value to a package-level var proxyEnvVarsMap = map[string]string{ ... } (or similar)
- Update all callers of
proxyEnvVars() to reference the package-level var directly, or keep the function as a thin accessor over the var
- Remove the function if no callers need encapsulation
- Run
make test to confirm no regressions
Files Affected
pkg/compiler/compiler_difc_proxy.go (630 lines)
Success Criteria
proxyEnvVars is a package-level var (allocated once at program start)
- All existing tests pass
go vet reports no issues
- No performance regression
Source
Extracted from [daily-compiler-quality] Daily Compiler Code Quality Report - 2026-07-20
Priority
Low — minor performance and readability improvement; low risk
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 44.8 AIC · ⌖ 7.87 AIC · ⊞ 7K · ◷
Description
compiler_difc_proxy.gocontains aproxyEnvVars()function that returns a 34-entry static map. Since the map never changes at runtime, it should be promoted to a package-levelvar(orconst-likevar). This removes the overhead of re-allocating the map on every call and improves readability by making the static nature explicit.This was flagged in the Daily Compiler Code Quality report. The file otherwise scores 85/100 (Good) with excellent tests.
Suggested Changes
proxyEnvVars()return value to a package-levelvar proxyEnvVarsMap = map[string]string{ ... }(or similar)proxyEnvVars()to reference the package-level var directly, or keep the function as a thin accessor over the varmake testto confirm no regressionsFiles Affected
pkg/compiler/compiler_difc_proxy.go(630 lines)Success Criteria
proxyEnvVarsis a package-levelvar(allocated once at program start)go vetreports no issuesSource
Extracted from [daily-compiler-quality] Daily Compiler Code Quality Report - 2026-07-20
Priority
Low — minor performance and readability improvement; low risk