pgtype icon indicating copy to clipboard operation
pgtype copied to clipboard

Compiled binary size is large

Open jackc opened this issue 5 years ago • 0 comments

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).

  1. One array type such as the existing ArrayType instead of a specific array type for each underlying type. This would save binary size at the possible expense of runtime performance.
  2. Array types and other less common types could be separated into other packages.

See also https://github.com/jackc/pgx/issues/822.

jackc avatar Sep 07 '20 17:09 jackc