mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-31 00:52:35 +02:00

Some checks are pending
Docker Image CI (socket-proxy) / build (push) Waiting to run
* refactor: simplify io code and make utils module independent * fix(docker): agent and socket-proxy docker event flushing with modified reverse proxy handler * refactor: remove unused code * refactor: remove the use of logging module in most code * refactor: streamline domain mismatch check in certState function * tweak: use ecdsa p-256 for autocert * fix(tests): update health check tests for invalid host and add case for port in host * feat(acme): custom acme directory * refactor: code refactor and improved context and error handling * tweak: optimize memory usage under load * fix(oidc): restore old user matching behavior * docs: add ChatGPT assistant to README --------- Co-authored-by: yusing <yusing@6uo.me>
43 lines
826 B
Go
43 lines
826 B
Go
package synk
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
var sizes = []int{1024, 4096, 16384, 65536, 32 * 1024, 128 * 1024, 512 * 1024, 1024 * 1024, 2 * 1024 * 1024}
|
|
|
|
func BenchmarkBytesPool_GetSmall(b *testing.B) {
|
|
for b.Loop() {
|
|
bytesPool.Put(bytesPool.GetSized(1024))
|
|
}
|
|
}
|
|
|
|
func BenchmarkBytesPool_MakeSmall(b *testing.B) {
|
|
for b.Loop() {
|
|
_ = make([]byte, 1024)
|
|
}
|
|
}
|
|
|
|
func BenchmarkBytesPool_GetLarge(b *testing.B) {
|
|
for b.Loop() {
|
|
bytesPool.Put(bytesPool.GetSized(1024 * 1024))
|
|
}
|
|
}
|
|
|
|
func BenchmarkBytesPool_MakeLarge(b *testing.B) {
|
|
for b.Loop() {
|
|
_ = make([]byte, 1024*1024)
|
|
}
|
|
}
|
|
|
|
func BenchmarkBytesPool_GetAll(b *testing.B) {
|
|
for i := range b.N {
|
|
bytesPool.Put(bytesPool.GetSized(sizes[i%len(sizes)]))
|
|
}
|
|
}
|
|
|
|
func BenchmarkBytesPool_MakeAll(b *testing.B) {
|
|
for i := range b.N {
|
|
_ = make([]byte, sizes[i%len(sizes)])
|
|
}
|
|
}
|