You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimization: statements reuse previous column name (#1711)
#1708 added `[]mysqlField` cache to stmt. It was used only for MariaDB cached metadata.
This commit allows MySQL to also benefit from the metadata cache. If the
column names are the same as the cached metadata, it reuses them instead
of allocating new strings.
goos: darwin
goarch: arm64
pkg: github.com/go-sql-driver/mysql
cpu: Apple M1 Pro
│ master.txt │ reuse.txt │
│ sec/op │ sec/op vs base │
ReceiveMetadata-8 1.273m ± 2% 1.269m ± 2% ~ (p=1.000 n=10)
│ master.txt │ reuse.txt │
│ B/op │ B/op vs base │
ReceiveMetadata-8 88.17Ki ± 0% 80.39Ki ± 0% -8.82% (p=0.000 n=10)
│ master.txt │ reuse.txt │
│ allocs/op │ allocs/op vs base │
ReceiveMetadata-8 1015.00 ± 0% 16.00 ± 0% -98.42% (p=0.000 n=10)
0 commit comments