1
0
mirror of https://github.com/uptrace/go-clickhouse.git synced 2025-06-08 23:26:11 +02:00

chore: disable compression in benchmarks

This commit is contained in:
Vladimir Mihailenco 2022-05-08 12:08:42 +03:00
parent 1983f91110
commit c84dc481ac
2 changed files with 8 additions and 12 deletions

View File

@ -6,7 +6,6 @@ import (
"time"
"github.com/uptrace/go-clickhouse/ch"
"github.com/uptrace/go-clickhouse/chdebug"
)
const query = `
@ -40,11 +39,10 @@ func benchmark(ctx context.Context, db *ch.DB) error {
func main() {
ctx := context.Background()
db := ch.Connect(ch.WithDatabase("test"))
db.AddQueryHook(chdebug.NewQueryHook(
chdebug.WithEnabled(false),
chdebug.FromEnv(""),
))
db := ch.Connect(
ch.WithDatabase("test"),
ch.WithCompression(false),
)
start := time.Now()
if err := benchmark(ctx, db); err != nil {

View File

@ -6,7 +6,6 @@ import (
"time"
"github.com/uptrace/go-clickhouse/ch"
"github.com/uptrace/go-clickhouse/chdebug"
)
type Model struct {
@ -35,11 +34,10 @@ func benchmark(ctx context.Context, db *ch.DB) error {
func main() {
ctx := context.Background()
db := ch.Connect(ch.WithDatabase("test"))
db.AddQueryHook(chdebug.NewQueryHook(
chdebug.WithEnabled(false),
chdebug.FromEnv(""),
))
db := ch.Connect(
ch.WithDatabase("test"),
ch.WithCompression(false),
)
if err := db.ResetModel(ctx, (*Model)(nil)); err != nil {
panic(err)