vendor/github.com/gorilla/websocket/doc.go
changeset 256 6d9efbef00a9
parent 251 1c52a0eeb952
equal deleted inserted replaced
255:4f153a23adab 256:6d9efbef00a9
   185 //
   185 //
   186 // Limit the buffer sizes to the maximum expected message size. Buffers larger
   186 // Limit the buffer sizes to the maximum expected message size. Buffers larger
   187 // than the largest message do not provide any benefit.
   187 // than the largest message do not provide any benefit.
   188 //
   188 //
   189 // Depending on the distribution of message sizes, setting the buffer size to
   189 // Depending on the distribution of message sizes, setting the buffer size to
   190 // to a value less than the maximum expected message size can greatly reduce
   190 // a value less than the maximum expected message size can greatly reduce memory
   191 // memory use with a small impact on performance. Here's an example: If 99% of
   191 // use with a small impact on performance. Here's an example: If 99% of the
   192 // the messages are smaller than 256 bytes and the maximum message size is 512
   192 // messages are smaller than 256 bytes and the maximum message size is 512
   193 // bytes, then a buffer size of 256 bytes will result in 1.01 more system calls
   193 // bytes, then a buffer size of 256 bytes will result in 1.01 more system calls
   194 // than a buffer size of 512 bytes. The memory savings is 50%.
   194 // than a buffer size of 512 bytes. The memory savings is 50%.
   195 //
   195 //
   196 // A write buffer pool is useful when the application has a modest number
   196 // A write buffer pool is useful when the application has a modest number
   197 // writes over a large number of connections. when buffers are pooled, a larger
   197 // writes over a large number of connections. when buffers are pooled, a larger