Skip to content

Commit

Permalink
cache charset bump (#8691)
Browse files Browse the repository at this point in the history
* [no-release-notes] bump for cache charset id

* add sysbench tests

* fix build

* [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh

* bump

---------

Co-authored-by: max-hoffman <max-hoffman@users.noreply.github.com>
  • Loading branch information
max-hoffman and max-hoffman authored Dec 19, 2024
1 parent 31c9a30 commit e71262c
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions go/performance/microsysbench/sysbench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"strings"
"testing"

"github.com/dolthub/go-mysql-server/server"
"github.com/dolthub/go-mysql-server/sql"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -60,6 +61,18 @@ func BenchmarkOltpPointSelect(b *testing.B) {
})
}

func BenchmarkTableScan(b *testing.B) {
benchmarkSysbenchQuery(b, func(int) string {
return "SELECT * FROM sbtest1"
})
}

func BenchmarkOltpIndexScan(b *testing.B) {
benchmarkSysbenchQuery(b, func(int) string {
return "SELECT * FROM sbtest1 WHERE k > 0"
})
}

func BenchmarkOltpJoinScan(b *testing.B) {
benchmarkSysbenchQuery(b, func(int) string {
return `select a.id, a.k
Expand Down Expand Up @@ -109,12 +122,17 @@ func BenchmarkSelectRandomRanges(b *testing.B) {
func benchmarkSysbenchQuery(b *testing.B, getQuery func(int) string) {
ctx, eng := setupBenchmark(b, dEnv)
for i := 0; i < b.N; i++ {
_, iter, _, err := eng.Query(ctx, getQuery(i))
schema, iter, _, err := eng.Query(ctx, getQuery(i))
require.NoError(b, err)
i := 0
for {
if _, err = iter.Next(ctx); err != nil {
i++
row, err := iter.Next(ctx)
if err != nil {
break
}
outputRow, err := server.RowToSQL(ctx, schema, row, nil)
_ = outputRow
}
require.Error(b, io.EOF)
err = iter.Close(ctx)
Expand Down

0 comments on commit e71262c

Please sign in to comment.