Skip to content

patch: vendor/golang.org/x/net: backport lazy hpack table maps #181

Description

@bradfitz

We backported this Go 1.28 change to our Go 1.27 tree:

commit b67ddcd
Date: Tue Sep 1 01:42:45 2026 +0000

[tailscale] vendor/golang.org/x/net: backport lazy hpack table maps

Backport upstream x/net commit 99c3b0a8f463 (CL 807260), "http2/hpack:
build the table lookup maps lazily, only for encoders". It landed on
x/net master after the go1.27 vendor branch was cut, so it is in Go
1.28's vendored x/net but not Go 1.27's.

The hpack table byName and byNameValue maps are only read by encoders,
but decoder dynamic tables maintained them anyway for every entry. For
servers with many mostly-idle HTTP/2 connections, each pinning a
decoder dynamic table for the connection's lifetime, those maps are a
meaningful fraction of per-connection memory: on one proxy instance
with ~124k long-poll connections, hpack table maps accounted for
~230MB of live heap.

This modifies only the vendored files, leaving go.mod and modules.txt
at the go1.27 vendor branch pseudo-version. Drop this patch at the
go1.28 rebase; it is upstream there.

Updates tailscale/corp#29053

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I27c8835c73221b48958ce47fc6f784c43fb4da51

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions