Conversation
The driver.Valuer is used for both text and binary representation, which isn't necessarily desired as the binary representation can be different. So also check for "BinaryValue() ([]byte, error)" in CheckNamedValue(), and use that if it exists. For the time being this is intentionally unexported and undocumented. I think this should be right, but I want to implement some more binary types before I'm sure. Also make the Hstore.Value() a bit faster: goos: linux goarch: amd64 pkg: github.com/lib/pq/hstore cpu: AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics BenchmarkHstore/Value-16 1228444 979.5 ns/op 904 B/op 11 allocs/op BenchmarkHstore/BinaryValue-16 3443780 362.9 ns/op 1008 B/op 3 allocs/op Previous for Value: BenchmarkHstore/Value-16 514468 2084 ns/op 2288 B/op 46 allocs/op Could make it faster still, but this was quick, fast, and obvious to do, and gets us more than double the performance. Fixes #705
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The driver.Valuer is used for both text and binary representation, which isn't necessarily desired as the binary representation can be different.
So also check for "BinaryValue() ([]byte, error)" in CheckNamedValue(), and use that if it exists.
For the time being this is intentionally unexported and undocumented. I think this should be right, but I want to implement some more binary types before I'm sure.
Also make the Hstore.Value() a bit faster:
Could make it faster still, but this was quick, fast, and obvious to do, and gets us more than double the performance.
Fixes #705