coder / coder/websocket

docs: Rationalize wsjson buffer pooling and explain tradeoffs

Offen
#418 8 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
docs
Vorherrschende Sprache
Go
Sterne
5.5k
Forks
372
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I see that this library is using `sync.Pool` to pool buffers for wsjon sub-package. `sync.Pool` is suitable only for pooling objects of same size. If they are of different size, you have a problem: those buffers will just grow and grow never to shrink.

See https://github.com/golang/go/issues/23199 for more background.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.