coder / coder/websocket

docs: Rationalize wsjson buffer pooling and explain tradeoffs

Aperta
#418 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
docs
Lingua principale
Go
Stelle
5.5k
Fork
372
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.