pgtype
pgtype copied to clipboard
Compiled binary size is large
Support for so many different types and automatic conversions doesn't come for free. This package appears to have a significant impact on program binary size.
Removing hstore and array types reduce the size of a binary by ~700k. It is unlikely that significant improvements can be made without breaking backwards compatibility. But consider the following changes if and when a major release is made (possibly when Go gets generics).
- One array type such as the existing
ArrayTypeinstead of a specific array type for each underlying type. This would save binary size at the possible expense of runtime performance. - Array types and other less common types could be separated into other packages.
See also https://github.com/jackc/pgx/issues/822.