func BenchmarkGocqlxInsert(b *testing.B) {
	people := loadFixtures()
	session := CreateSession(b)
	defer session.Close()
	if err := session.ExecStmt(benchPersonSchema); err != nil {
		b.Fatal(err)
	}
	stmt, names := qb.Insert("gocqlx_test.bench_person").Columns(benchPersonCols...).ToCql()
	q := session.Query(stmt, names)
	defer q.Release()
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		p := people[i%len(people)]
		if err := q.BindStruct(p).Exec(); err != nil {
			b.Fatal(err)
		}
	}
}
BenchmarkGocqlInsert performs insert with struct binding.
package gocqlx_test
import (
	"encoding/json"
	"os"
	"testing"
	"github.com/scylladb/gocqlx/v2"
	. "github.com/scylladb/gocqlx/v2/gocqlxtest"
	"github.com/scylladb/gocqlx/v2/qb"
)
type benchPerson struct {
	ID        int      `json:"id"`
	FirstName string   `json:"first_name"`
	LastName  string   `json:"last_name"`
	Email     []string `json:"email"`
	Gender    string   `json:"gender"`
	IPAddress string   `json:"ip_address"`
}
var benchPersonSchema = `
CREATE TABLE IF NOT EXISTS gocqlx_test.bench_person (
    id int,
    first_name text,
    last_name text,
    email list<text>,
    gender text,
    ip_address text,
    PRIMARY KEY(id)
)`
var benchPersonCols = []string{"id", "first_name", "last_name", "email", "gender", "ip_address"}
func BenchmarkBaseGocqlInsert(b *testing.B) {
	people := loadFixtures()
	session := CreateSession(b)
	defer session.Close()
	if err := session.ExecStmt(benchPersonSchema); err != nil {
		b.Fatal(err)
	}
	stmt, _ := qb.Insert("gocqlx_test.bench_person").Columns(benchPersonCols...).ToCql()
	q := session.Session.Query(stmt)
	defer q.Release()
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		p := people[i%len(people)]
		if err := q.Bind(p.ID, p.FirstName, p.LastName, p.Email, p.Gender, p.IPAddress).Exec(); err != nil {
			b.Fatal(err)
		}
	}
}