func BenchmarkORMQuery(b *testing.B) {
	db, err := orm.Open("sqlite3", ":memory:")
	require.Nil(b, err)
	defer db.Close()
	porm, err := tests.NewPersonORM(db)
	require.Nil(b, err)
	require.Nil(b, porm.Create().Exec())
	for i := 0; i < datasetSize; i++ {
		_, err = porm.Insert().InsertPerson(&tests.Person{Name: "xxx", Age: i}).Exec()
		require.Nil(b, err)
	}
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		_, err := porm.Select().Query()
		require.Nil(b, err)
	}
}
BenchmarkORMQuery tests queries with posener/orm package
package main
import (
	"database/sql"
	"testing"
	"time"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/sqlite"
	"github.com/posener/orm"
	"github.com/posener/orm/tests"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)
func BenchmarkORMInsert(b *testing.B) {
	db, err := orm.Open("sqlite3", ":memory:")
	require.Nil(b, err)
	defer db.Close()
	porm, err := tests.NewPersonORM(db)
	require.Nil(b, err)
	require.Nil(b, porm.Create().Exec())
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		_, err = porm.Insert().InsertPerson(&tests.Person{Name: "xxx", Age: i}).Exec()
		assert.Nil(b, err)
	}
}
func BenchmarkGORMInsert(b *testing.B) {
	db, err := gorm.Open("sqlite3", ":memory:")
	require.Nil(b, err)
	defer db.Close()
	err = db.AutoMigrate(&tests.Person{}).Error
	require.Nil(b, err)
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		err = db.Create(&tests.Person{Name: "xxx", Age: i}).Error
		assert.Nil(b, err)
	}
}
func BenchmarkRawInsert(b *testing.B) {
	db, err := sql.Open("sqlite3", ":memory:")
	require.Nil(b, err)
	defer db.Close()
	_, err = db.Exec(`CREATE TABLE 'person' ( 'name' VARCHAR (255), 'age' INTEGER )`)
	require.Nil(b, err)
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		_, err = db.Exec(`INSERT INTO 'person' ('name', 'age') VALUES (?, ?)`, "xxx", i)
		assert.Nil(b, err)
	}
}
const datasetSize = 1000