update delete benchmarks

This commit is contained in:
Muhammed Efe Cetin
2023-09-15 18:23:02 +03:00
parent 36dd674d93
commit db1dd2bf6a
21 changed files with 109 additions and 93 deletions

View File

@@ -158,14 +158,13 @@ func Benchmark_ArangoDB_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_ArangoDB_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_ArangoDB_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -163,14 +163,13 @@ func Benchmark_AzureBlob_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_AzureBlob_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_AzureBlob_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -148,13 +148,12 @@ func Benchmark_Badger_Get(b *testing.B) {
}
func Benchmark_Badger_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -137,13 +137,12 @@ func Benchmark_Bbolt_Get(b *testing.B) {
}
func Benchmark_Bbolt_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -216,14 +216,13 @@ func Benchmark_Coherence_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Coherence_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Coherence_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -129,16 +129,15 @@ func Benchmark_Couchbase_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Couchbase_Delete(b *testing.B) {
func Benchmark_Couchbase_SetAndDelete(b *testing.B) {
testStore := newTestStore(b)
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -115,3 +115,42 @@ func Test_DynamoDB_Close(t *testing.T) {
func Test_DynamoDB_Conn(t *testing.T) {
require.True(t, testStore.Conn() != nil)
}
func Benchmark_DynamoDB_Set(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
err = testStore.Set("john", []byte("doe"), 0)
}
require.NoError(b, err)
}
func Benchmark_DynamoDB_Get(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, err = testStore.Get("john")
}
require.NoError(b, err)
}
func Benchmark_DynamoDB_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}
require.NoError(b, err)
}

View File

@@ -118,14 +118,13 @@ func Benchmark_Etcd_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Etcd_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Etcd_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -157,14 +157,13 @@ func Benchmark_Memcache_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Memcache_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Memcache_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -174,14 +174,13 @@ func Benchmark_Memory_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Memory_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Memory_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -220,14 +220,13 @@ func Benchmark_Minio_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Minio_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Minio_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -157,14 +157,13 @@ func Benchmark_MongoDB_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_MongoDB_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_MongoDB_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -200,14 +200,13 @@ func Benchmark_MSSQL_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_MSSQL_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_MSSQL_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -216,14 +216,13 @@ func Benchmark_MYSQL_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_MYSQL_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_MYSQL_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -132,14 +132,13 @@ func Benchmark_Pebble_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Pebble_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Pebble_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -197,14 +197,13 @@ func Benchmark_Postgres_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Postgres_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Postgres_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -154,7 +154,6 @@ func Test_Redis_Initalize_WithURL_TLS(t *testing.T) {
tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
PreferServerCipherSuites: true,
InsecureSkipVerify: true,
Certificates: []tls.Certificate{cer},
CipherSuites: []uint16{
@@ -197,7 +196,6 @@ func Test_Redis_Initalize_WithURL_TLS_Verify(t *testing.T) {
tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
PreferServerCipherSuites: true,
InsecureSkipVerify: false,
Certificates: []tls.Certificate{cer},
CipherSuites: []uint16{
@@ -441,14 +439,13 @@ func Benchmark_Redis_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Redis_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Redis_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -84,7 +84,7 @@ func Test_Ristretto_Set_Expiration(t *testing.T) {
err := testStore.Set(key, val, exp)
require.NoError(t, err)
testStore.Reset()
require.NoError(t, testStore.Reset())
}
func Test_Ristretto_Get_Expired(t *testing.T) {
@@ -190,14 +190,13 @@ func Benchmark_Ristretto_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Ristretto_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Ristretto_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -132,7 +132,6 @@ func Test_Rueidis_WithTLS(t *testing.T) {
tlsCfg := &tls.Config{
MinVersion: tls.VersionTLS12,
CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
PreferServerCipherSuites: true,
InsecureSkipVerify: true,
Certificates: []tls.Certificate{cer},
CipherSuites: []uint16{
@@ -264,14 +263,13 @@ func Benchmark_Rueidis_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_Rueidis_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_Rueidis_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -121,14 +121,13 @@ func Benchmark_S3_Get(b *testing.B) {
require.NoError(b, err)
}
func Benchmark_S3_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
func Benchmark_S3_SetAndDelete(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}

View File

@@ -183,13 +183,12 @@ func Benchmark_SQLite3_Get(b *testing.B) {
}
func Benchmark_SQLite3_Delete(b *testing.B) {
err := testStore.Set("john", []byte("doe"), 0)
require.NoError(b, err)
b.ReportAllocs()
b.ResetTimer()
var err error
for i := 0; i < b.N; i++ {
_ = testStore.Set("john", []byte("doe"), 0)
err = testStore.Delete("john")
}