Files
gocqlx/qb/select_bench_test.go
Gian Lorenzo Meocci 9239d9c4b4 add UseColums function to avoid extra allocation performed by Colums function
fix name

tidy

adding SetWhere

adding SetWhere

fix go mod

fix comment style

revert go mod

Avoid to append if no needed

fix git ignore

revert change in go.sum/go.mod

adding specific benchmark
2019-12-16 11:14:11 +01:00

32 lines
651 B
Go

// Copyright (C) 2017 ScyllaDB
// Use of this source code is governed by a ALv2-style
// license that can be found in the LICENSE file.
package qb
import "testing"
func BenchmarkSelectBuilder(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
Select("cycling.cyclist_name").
Columns("id", "user_uuid", "firstname", "surname", "stars").
Where(Eq("id")).
ToCql()
}
}
func BenchmarkSelectBuildAssign(b *testing.B) {
b.ResetTimer()
cols := []string{
"id", "user_uuid", "firstname",
"surname", "stars",
}
for i := 0; i < b.N; i++ {
Select("cycling.cyclist_name").
Columns(cols...).
Where(Eq("id")).
ToCql()
}
}