Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Remove byte slice in ColumnAlloc #1774

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

j2gg0s
Copy link
Contributor

@j2gg0s j2gg0s commented Nov 5, 2020

If we don't reuse ColumnaAlloc's byte slice, we can remove it and simple logic.

Benchmark with current version

➜  pool git:(v10) ✗ go test ./... -bench=BenchmarkColumnAlloc
Running Suite: pool
===================
Random Seed: 1604545377
Will run 23 of 23 specs

•••••••••••••••••••••••
Ran 23 of 23 Specs in 0.419 seconds
SUCCESS! -- 23 Passed | 0 Failed | 0 Pending | 0 Skipped
goos: darwin
goarch: amd64
pkg: github.com/go-pg/pg/v10/internal/pool
BenchmarkColumnAlloc-8           5052452               234 ns/op
PASS
ok      github.com/go-pg/pg/v10/internal/pool   2.151s

Benchmark with new version

➜  pool git:(feat-simple-column-alloc) go test ./... -bench=BenchmarkColumnAlloc
Running Suite: pool
===================
Random Seed: 1604545352
Will run 23 of 23 specs

•••••••••••••••••••••••
Ran 23 of 23 Specs in 0.379 seconds
SUCCESS! -- 23 Passed | 0 Failed | 0 Pending | 0 Skipped
goos: darwin
goarch: amd64
pkg: github.com/go-pg/pg/v10/internal/pool
BenchmarkColumnAlloc-8           4844086               237 ns/op
PASS
ok      github.com/go-pg/pg/v10/internal/pool   2.135s

@vmihailenco
Copy link
Member

Thanks

@vmihailenco vmihailenco merged commit e656d81 into go-pg:v10 Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants