benchmark

package
v0.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeforeBenchmark

func BeforeBenchmark()

Types

type Benchmark

type Benchmark interface {
	Init() error
	Close() error
	Insert(b *testing.B)
	InsertBulk(b *testing.B)
	Update(b *testing.B)
	Delete(b *testing.B)
	FindByID(b *testing.B)
	FindPage(b *testing.B)
}

Benchmark interface was inspired by https://github.com/efectn/go-orm-benchmarks/blob/master/helper/suite.go.

func NewGoeBenchmark

func NewGoeBenchmark() Benchmark

func NewGoentBenchmark

func NewGoentBenchmark() Benchmark

func NewRawBenchmark

func NewRawBenchmark() Benchmark

func NewRawPgxPoolBenchmark

func NewRawPgxPoolBenchmark() Benchmark

type Database

type Database struct {
	Book *models.Book
	*goe.DB
}

type GoeBenchmark

type GoeBenchmark struct {
	// contains filtered or unexported fields
}

func (*GoeBenchmark) Close

func (o *GoeBenchmark) Close() error

func (*GoeBenchmark) Delete

func (o *GoeBenchmark) Delete(b *testing.B)

func (*GoeBenchmark) FindByID

func (o *GoeBenchmark) FindByID(b *testing.B)

func (*GoeBenchmark) FindPage

func (o *GoeBenchmark) FindPage(b *testing.B)

func (*GoeBenchmark) Init

func (o *GoeBenchmark) Init() (err error)

func (*GoeBenchmark) Insert

func (o *GoeBenchmark) Insert(b *testing.B)

func (*GoeBenchmark) InsertBulk

func (o *GoeBenchmark) InsertBulk(b *testing.B)

func (*GoeBenchmark) Update

func (o *GoeBenchmark) Update(b *testing.B)

type GoentBenchmark

type GoentBenchmark struct {
	// contains filtered or unexported fields
}

func (*GoentBenchmark) Close

func (o *GoentBenchmark) Close() error

func (*GoentBenchmark) Delete

func (o *GoentBenchmark) Delete(b *testing.B)

func (*GoentBenchmark) FindByID

func (o *GoentBenchmark) FindByID(b *testing.B)

func (*GoentBenchmark) FindPage

func (o *GoentBenchmark) FindPage(b *testing.B)

func (*GoentBenchmark) Init

func (o *GoentBenchmark) Init() (err error)

func (*GoentBenchmark) Insert

func (o *GoentBenchmark) Insert(b *testing.B)

func (*GoentBenchmark) InsertBulk

func (o *GoentBenchmark) InsertBulk(b *testing.B)

func (*GoentBenchmark) Update

func (o *GoentBenchmark) Update(b *testing.B)

type GoentDatabase

type GoentDatabase struct {
	PublicSchema `goe:"public"`
	*goent.DB
}

type PublicSchema

type PublicSchema struct {
	Book *goent.Table[models.Book]
}

type RawBenchmark

type RawBenchmark struct {
	// contains filtered or unexported fields
}

func (*RawBenchmark) Close

func (r *RawBenchmark) Close() error

func (*RawBenchmark) Delete

func (r *RawBenchmark) Delete(b *testing.B)

func (*RawBenchmark) FindByID

func (r *RawBenchmark) FindByID(b *testing.B)

func (*RawBenchmark) FindPage

func (r *RawBenchmark) FindPage(b *testing.B)

func (*RawBenchmark) Init

func (r *RawBenchmark) Init() error

func (*RawBenchmark) Insert

func (r *RawBenchmark) Insert(b *testing.B)

func (*RawBenchmark) InsertBulk

func (r *RawBenchmark) InsertBulk(b *testing.B)

func (*RawBenchmark) Update

func (r *RawBenchmark) Update(b *testing.B)

type RawPgxPoolBenchmark

type RawPgxPoolBenchmark struct {
	// contains filtered or unexported fields
}

RawPgxPoolBenchmark uses pgxpool directly for fair comparison with goent.

func (*RawPgxPoolBenchmark) Close

func (r *RawPgxPoolBenchmark) Close() error

func (*RawPgxPoolBenchmark) Delete

func (r *RawPgxPoolBenchmark) Delete(b *testing.B)

func (*RawPgxPoolBenchmark) FindByID

func (r *RawPgxPoolBenchmark) FindByID(b *testing.B)

func (*RawPgxPoolBenchmark) FindPage

func (r *RawPgxPoolBenchmark) FindPage(b *testing.B)

func (*RawPgxPoolBenchmark) Init

func (r *RawPgxPoolBenchmark) Init() error

func (*RawPgxPoolBenchmark) Insert

func (r *RawPgxPoolBenchmark) Insert(b *testing.B)

func (*RawPgxPoolBenchmark) InsertBulk

func (r *RawPgxPoolBenchmark) InsertBulk(b *testing.B)

func (*RawPgxPoolBenchmark) Update

func (r *RawPgxPoolBenchmark) Update(b *testing.B)

type ResultWrapper

type ResultWrapper struct {
	Orm        string
	Benchmarks map[string]testing.BenchmarkResult
	Err        error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL