From 4d0922769ade91fe11be0bb31274e5a0ad1e9b4c Mon Sep 17 00:00:00 2001 From: Kyle Xiao Date: Wed, 21 Aug 2024 20:57:07 +0800 Subject: [PATCH] chore: rm unused test code --- cache/mempool/mempool_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cache/mempool/mempool_test.go b/cache/mempool/mempool_test.go index 7e5f65a..f5bfd2b 100644 --- a/cache/mempool/mempool_test.go +++ b/cache/mempool/mempool_test.go @@ -17,7 +17,6 @@ package mempool import ( - "runtime/debug" "testing" "unsafe" @@ -44,8 +43,6 @@ func TestCap(t *testing.T) { } func TestAppend(t *testing.T) { - debug.SetGCPercent(-1) // make sure the buf in pools will not be recycled - defer debug.SetGCPercent(100) // reset to 100 str := "TestAppend" b := Malloc(0) for i := 0; i < 2000; i++ { @@ -85,9 +82,11 @@ func TestFree(t *testing.T) { func Benchmark_MallocFree(b *testing.B) { b.ReportAllocs() b.RunParallel(func(pb *testing.PB) { + i := 0 for pb.Next() { - b := Malloc(1) + b := Malloc(i & 0xffff) Free(b) + i++ } }) }