Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 2.01 KB

README.md

File metadata and controls

36 lines (24 loc) · 2.01 KB

SQLBoiler Benchmarks

Requirements

These tests require go1.11 (go1.11 has support for go modules that are used here, go1.14 is recommended as current benchmarks were run using go1.14) and installed docker

Instructions

  1. Clone this repository.
  2. Update a sqlboiler.toml in the root directory if needed.
  3. Modify port initdb.sh and run ./initdb.sh to create your db and generate your models folder.
  4. Run the benches against mocked (mimic) driver: go test -bench . -benchmem

Previous results can be found in ./results/mocked_driver.txt

go-pg benchmarks

As go-pg is not implementing database/sql, to compare database/sql based implementations benchmarks should be run against real db

in /go_pg directory you will find files related to benchmarks comparison of sqlc, sqlboiler against go-pg both for CockroachDB and PostgresDB (all using docker), benchmarks are using same approach as described in go-pg repository

  1. Run benchmark against CockroachDB (it will also set up DB, generate all needed files): ./go_pg/prepare_and_run_cockroach.sh Previous results can be found in ./results/go_pg_cockroach.txt
  2. Run benchmark against PostgresDB (it will also set up DB, generate all needed files): ./go_pg/prepare_and_run_postgres.sh Previous results can be found in ./results/go_pg_postgres.txt

Inside each correspondent script variable port is defined. Override it if standard DB ports are already occupied on your machine.

Note: There are some ruby and python scripts for generating graphs from many runs of these benchmarks. They can be used to help update the sqlboiler README with new graphs.

Graphs can be found in the SQLBoiler readme.

The homepage for the SQLBoiler is located at: https://github.com/volatiletech/sqlboiler