Repository: grpc/grpc-go
File: experimental/experimental.go (Go)

Code before:
// will generate a lot of garbage, reducing the overall benefit from using a
// pool.
func WithBufferPool(bufferPool mem.BufferPool) grpc.DialOption {
	return internal.WithBufferPool.(func(mem.BufferPool) grpc.DialOption)(bufferPool)
}

// BufferPool returns a grpc.ServerOption that configures the server to use the
// provided buffer pool for parsing incoming messages and for temporary buffers
// when marshaling outgoing messages. By default, mem.DefaultBufferPool is used,
// and this option only exists to provide alternative buffer pool implementations
// to the server, such as more optimized size allocations etc. However, the
// default buffer pool is already tuned to account for many different use-cases.
//
// Note: The following options will interfere with the buffer pool because they
// require a fully materialized buffer instead of a sequence of buffers:
// EnableTracing, and binary logging. In such cases, materializing the buffer
// will generate a lot of garbage, reducing the overall benefit from using a
// pool.
func BufferPool(bufferPool mem.BufferPool) grpc.ServerOption {
	return internal.BufferPool.(func(mem.BufferPool) grpc.ServerOption)(bufferPool)
}

// AcceptedCompressionNames returns a CallOption that limits the values
// advertised in the grpc-accept-encoding header for the provided RPC. The
// supplied names must correspond to compressors registered via
// encoding.RegisterCompressor. Passing no names advertises identity only.
func AcceptedCompressionNames(names ...string) grpc.CallOption {
	return internal.AcceptedCompressionNames.(func(...string) grpc.CallOption)(names...)
}


Review comment (suggestion):
```suggestion
// encoding.RegisterCompressor. Passing no names advertises "identity" (no
// compression) only.
```

Code after:
// will generate a lot of garbage, reducing the overall benefit from using a
// pool.
func WithBufferPool(bufferPool mem.BufferPool) grpc.DialOption {
	return internal.WithBufferPool.(func(mem.BufferPool) grpc.DialOption)(bufferPool)
}

// BufferPool returns a grpc.ServerOption that configures the server to use the
// provided buffer pool for parsing incoming messages and for temporary buffers
// when marshaling outgoing messages. By default, mem.DefaultBufferPool is used,
// and this option only exists to provide alternative buffer pool implementations
// to the server, such as more optimized size allocations etc. However, the
// default buffer pool is already tuned to account for many different use-cases.
//
// Note: The following options will interfere with the buffer pool because they
// require a fully materialized buffer instead of a sequence of buffers:
// EnableTracing, and binary logging. In such cases, materializing the buffer
// will generate a lot of garbage, reducing the overall benefit from using a
// pool.
func BufferPool(bufferPool mem.BufferPool) grpc.ServerOption {
	return internal.BufferPool.(func(mem.BufferPool) grpc.ServerOption)(bufferPool)
}

// AcceptCompressors returns a CallOption that limits the values
// advertised in the grpc-accept-encoding header for the provided RPC. The
// supplied names must correspond to compressors registered via
// encoding.RegisterCompressor. Passing no names advertises "identity" (no
// compression) only.
func AcceptCompressors(names ...string) grpc.CallOption {
	return internal.AcceptCompressors.(func(...string) grpc.CallOption)(names...)
}