Skip to content

Instantly share code, notes, and snippets.

@andrewdoss-bit
Created December 28, 2021 20:52
Show Gist options
  • Save andrewdoss-bit/181e16d222eaf7e2f9b85b01c6cb0477 to your computer and use it in GitHub Desktop.
Save andrewdoss-bit/181e16d222eaf7e2f9b85b01c6cb0477 to your computer and use it in GitHub Desktop.
pgx connection function benchmarks
package database
import (
"testing"
)
func BenchmarkConnWithName(b *testing.B) {
for i := 0; i < b.N; i++ {
ConnWithName()
}
}
func BenchmarkConnWithoutName(b *testing.B) {
for i := 0; i < b.N; i++ {
ConnWithoutName()
}
}
func BenchmarkPoolWithName(b *testing.B) {
for i := 0; i < b.N; i++ {
PoolWithName()
}
}
func BenchmarkPoolWithoutName(b *testing.B) {
for i := 0; i < b.N; i++ {
PoolWithoutName()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment