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: fast encodeUUID #1882

Merged
merged 1 commit into from
Jan 21, 2024
Merged

feat: fast encodeUUID #1882

merged 1 commit into from
Jan 21, 2024

Conversation

slipros
Copy link
Contributor

@slipros slipros commented Jan 20, 2024

Hello @jackc!

The benchmark speaks for itself

goos: windows
goarch: amd64
pkg: test
cpu: 12th Gen Intel(R) Core(TM) i9-12900K
Benchmark_encodeUUID
Benchmark_encodeUUID-16                  1312166               900.1 ns/op
             736 B/op         28 allocs/op
Benchmark_fastEncodeUUID
Benchmark_fastEncodeUUID-16           10241485               109.3 ns/op
             192 B/op          4 allocs/op
PASS

This change has significantly reduced the number of allocations in my queries

goos: windows
goarch: amd64
pkg: test
cpu: 12th Gen Intel(R) Core(TM) i9-12900K
BenchmarkSelect_encodeUUID
BenchmarkSelect_encodeUUID-16          1455            993028 ns/op           95501 B/op
            2593 allocs/op
BenchmarkSelect_fastEncodeUUID
BenchmarkSelect_fastEncodeUUID-16          1486            820928 ns/op          112806 B/op
            1357 allocs/op
PASS

@jackc jackc merged commit 517c654 into jackc:master Jan 21, 2024
14 checks passed
@slipros slipros deleted the develop branch January 21, 2024 11:27
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