mirror of
https://github.com/ent/ent.git
synced 2026-05-06 01:20:56 +03:00
all: add (*testing.B).ReportAllocs() to all benchmarks (#1919)
This allows a full picture when continuous benchmarking is added to this repository and when any changes are made to the code in here. Fixes #1918
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
func BenchmarkInsertBuilder_Default(b *testing.B) {
|
||||
for _, d := range []string{dialect.SQLite, dialect.MySQL, dialect.Postgres} {
|
||||
b.Run(d, func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
Dialect(d).Insert("users").Default().Returning("id").Query()
|
||||
}
|
||||
@@ -23,6 +24,7 @@ func BenchmarkInsertBuilder_Default(b *testing.B) {
|
||||
func BenchmarkInsertBuilder_Small(b *testing.B) {
|
||||
for _, d := range []string{dialect.SQLite, dialect.MySQL, dialect.Postgres} {
|
||||
b.Run(d, func(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
Dialect(d).Insert("users").
|
||||
Columns("id", "age", "first_name", "last_name", "nickname", "spouse_id", "created_at", "updated_at").
|
||||
|
||||
Reference in New Issue
Block a user