good morning!!!!

Skip to content
Snippets Groups Projects
Commit 4d8c2a2e authored by José Carlos Nieto's avatar José Carlos Nieto
Browse files

Adding benchmarks

parent de7dfc95
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,62 @@ import (
"testing"
)
func BenchmarkColumn(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Column{"a"}
}
}
func BenchmarkColumnNestedValue(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Column{Value: "a"}
}
}
func BenchmarkCompileColumn(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Column{Value: "a"}.Compile(defaultTemplate)
}
}
func BenchmarkValue(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Value{"a"}
}
}
func BenchmarkValueRaw(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Value{Raw{"a"}}
}
}
func BenchmarkColumnValue(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = ColumnValue{Column{"a"}, "=", Value{Raw{"7"}}}
}
}
func BenchmarkTable(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Table{"foo"}
}
}
func BenchmarkCompileTable(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Table{"foo"}.Compile(defaultTemplate)
}
}
func BenchmarkWhere(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = Where{
ColumnValue{Column{"a"}, "=", Value{Raw{"7"}}},
}
}
}
func BenchmarkCompileSelect(b *testing.B) {
var stmt Statement
......@@ -15,7 +71,6 @@ func BenchmarkCompileSelect(b *testing.B) {
ColumnValue{Column{"a"}, "=", Value{Raw{"7"}}},
},
}
stmt.Compile(defaultTemplate)
_ = stmt.Compile(defaultTemplate)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment