I have found these related issues/pull requests
#3651
Description
Hello,
The new PgBindIter is awesome, but it seems that it allocates too much memory.
I would like to submit a PR to .reserve() the PgArgumentBuffer using iter.size_hint() in encode_inner https://github.com/launchbadge/sqlx/blob/e8384f2a00173c2b120eea72e99d120557fced8b/sqlx-postgres/src/bind_iter.rs#L83
in order to reduce the number of allocations performed by PgArgumentBuffer.
Prefered solution
.reserve() the PgArgumentBuffer using iter.size_hint() in encode_inner
Is this a breaking change? Why or why not?
no, just a small improvement, 1-line change
I have found these related issues/pull requests
#3651
Description
Hello,
The new
PgBindIteris awesome, but it seems that it allocates too much memory.I would like to submit a PR to
.reserve()thePgArgumentBufferusingiter.size_hint()inencode_innerhttps://github.com/launchbadge/sqlx/blob/e8384f2a00173c2b120eea72e99d120557fced8b/sqlx-postgres/src/bind_iter.rs#L83in order to reduce the number of allocations performed by
PgArgumentBuffer.Prefered solution
.reserve()thePgArgumentBufferusingiter.size_hint()inencode_innerIs this a breaking change? Why or why not?
no, just a small improvement, 1-line change