-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql/pgwire: binary encoding for bool, decimal, and string #6661
Conversation
|
Reviewed 1 of 1 files at r2, 1 of 1 files at r3, 1 of 1 files at r4, 3 of 3 files at r5, 1 of 4 files at r6, 4 of 4 files at r9. acceptance/c_test.go, line 67 [r5] (raw file):
Should all of these be commented out? Don't we want to test other data types? sql/pgwire/types.go, line 63 [r5] (raw file):
sql/pgwire/types.go, line 72 [r5] (raw file):
A comment here would be helpful. That said, PG's comment sql/pgwire/types.go, line 221 [r5] (raw file):
👍 sql/pgwire/types.go, line 242 [r5] (raw file):
sql/pgwire/types.go, line 509 [r5] (raw file):
Same thing about the benchmark here. I'm less convinced that working with a string would help, but I'd love to get numbers on it, and having the benchmark also gives us a foundation to base future optimizations off of. Really any of these marshaling or unmarshmaling routines that aren't dead simple could benefit from having an associated benchmark as well, given that these are going to be in critical path of almost all queries and will will see usage scale linearly with the size of the query results. However, the types not touched here are out of the scope of this change. Comments from Reviewable |
Review status: 3 of 6 files reviewed at latest revision, 5 unresolved discussions, some commit checks pending. acceptance/c_test.go, line 67 [r5] (raw file):
|
Reviewed 2 of 4 files at r10. sql/pgwire/types.go, line 72 [r5] (raw file):
|
Review status: 4 of 6 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. sql/pgwire/types.go, line 72 [r5] (raw file):
|
Nice! I'll give you your hard earned LGTM once we have a decoding benchmark.
|
Done.
|
Sure looks like all big arithmetic allocates. Let me see about optimizing decoding.
|
``` BenchmarkWriteBinaryDecimal-4 500000 2564 ns/op 160 B/op 4 allocs/op BenchmarkDecodeBinaryDecimal-4 300000 4491 ns/op 384 B/op 19 allocs/op ```
|
Depends on cockroachdb/postgres-test#9
Fixes #6526.
cc @mjibson for the test.
This change is