2018-05-22 16:37:02 +02:00
|
|
|
// 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++ {
|
2019-10-27 16:37:36 +01:00
|
|
|
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()
|
2018-05-22 16:37:02 +02:00
|
|
|
}
|
|
|
|
|
}
|