perf: reuse immutable TLS profile snapshots - #5
Draft
Joshua Tenner (jtenner) wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack status
agent/tls-full-grid4c844beeddbfa630186510604passed every required check for head4c844beon July 26, 2026Summary
Removes redundant per-stream deep copies of TLS profile state while preserving the existing immutable profile boundary and fail-closed validation.
crypto/tls.Config's shallow per-connection shell needed to set the authorizedServerNamecrypto/tls.Conn, transport, and profile references immediately after workers join, so stale closed wrappers cannot pin large buffers or certificate/CA graphsCorrectness and race evidence
Allocation and performance evidence
Controlled linux/amd64 Go 1.24.4 benchmarks:
391,650 B/op, 964 allocations before;390,050 B/op, 952 allocations after391,220 B/op, 954 allocations before;389,650 B/op, 948 allocations after382 KiB/op, 45 allocations, 40–44 µs before;282 KiB/op, 37 allocations, 30–35 µs afterThe complete benchmark smoke matrix discovers and passes 174 top-level targets in 50 packages, expanding to 204 result names.
Validation
go test -shuffle=on -count=1 ./...go vet ./...scripts/tls-signoff.shscripts/benchmark-smoke.shmatrixExplicitly unchanged
No guest ABI, capability, cryptographic primitive, TLS version default, session-resumption authority, listener authority, TinyGo support claim, or release-adoption claim changes in this pull request.