diff --git a/bbolt/bbolt_test.go b/bbolt/bbolt_test.go index e53918c93..565dd173c 100644 --- a/bbolt/bbolt_test.go +++ b/bbolt/bbolt_test.go @@ -136,7 +136,7 @@ func Benchmark_Bbolt_Get(b *testing.B) { require.NoError(b, err) } -func Benchmark_Bbolt_Delete(b *testing.B) { +func Benchmark_Bbolt_SetAndDelete(b *testing.B) { b.ReportAllocs() b.ResetTimer() diff --git a/memory/memory_test.go b/memory/memory_test.go index c5f75a246..c80fce93d 100644 --- a/memory/memory_test.go +++ b/memory/memory_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - "github.com/gofiber/utils/v2" "github.com/stretchr/testify/require" ) @@ -120,34 +119,6 @@ func Test_Storage_Memory_Conn(t *testing.T) { require.True(t, testStore.Conn() != nil) } -// go test -v -run=^$ -bench=Benchmark_Storage_Memory -benchmem -count=4 -func Benchmark_Storage_Memory(b *testing.B) { - keyLength := 1000 - keys := make([]string, keyLength) - for i := 0; i < keyLength; i++ { - keys[i] = utils.UUID() - } - value := []byte("joe") - - ttl := 2 * time.Second - b.Run("fiber_memory", func(b *testing.B) { - d := New() - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - for _, key := range keys { - d.Set(key, value, ttl) - } - for _, key := range keys { - _, _ = d.Get(key) - } - for _, key := range keys { - d.Delete(key) - } - } - }) -} - func Benchmark_Memory_Set(b *testing.B) { b.ReportAllocs() b.ResetTimer() diff --git a/sqlite3/sqlite3_test.go b/sqlite3/sqlite3_test.go index c07689be9..c7965ac1f 100644 --- a/sqlite3/sqlite3_test.go +++ b/sqlite3/sqlite3_test.go @@ -182,7 +182,7 @@ func Benchmark_SQLite3_Get(b *testing.B) { require.NoError(b, err) } -func Benchmark_SQLite3_Delete(b *testing.B) { +func Benchmark_SQLite3_SetAndDelete(b *testing.B) { b.ReportAllocs() b.ResetTimer()