mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-17 01:30:34 +00:00
Part 1: Optimize using compiler's inliner (#2687)
* optimized functions for inlining * added note regarding ResponseWriterWrapper * optimzed browseWrite* methods for FileServer * created benchmarks for comparison * creating browseListing instance in each function * created benchmarks for openResponseWriter * removed benchmarks of old implementations * implemented sync.Pool for byte buffers * using global sync.Pool for writing JSON/HTML
This commit is contained in:
12
modules/caddyhttp/encode/encode_test.go
Normal file
12
modules/caddyhttp/encode/encode_test.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package encode
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkOpenResponseWriter(b *testing.B) {
|
||||
enc := new(Encode)
|
||||
for n := 0; n < b.N; n++ {
|
||||
enc.openResponseWriter("test", nil)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user