Skip to content

net/http: do not query HTTP_PROXY on every request #7020

@dvyukov

Description

@dvyukov
Do we need to query HTTP_PROXY env var before every request? The docs are quite vague.
Do we want to support a use case when an application itself changes HTTP_PROXY at
runtime? Then I think the app just need to specify the proxy programmatically rather
than changing HTTP_PROXY.

I am asking because querying HTTP_PROXY accounts for 15% of memory allocations on
end-to-end client/server http benchmark (10% of garbage generated).

Windows syscall package reallocates the string several times and we query it twice.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions