stablekernel / postgresql-dart

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.
https://www.dartdocs.org/documentation/postgres/latest
BSD 3-Clause "New" or "Revised" License
129 stars 32 forks source link

Connection time ~5-8x longer to Postgres14 #170

Closed zambetpentru closed 1 year ago

zambetpentru commented 2 years ago

Hi,

I noticed when testing an upgrade to PostgreSQL14 that there is about a 5-8x connection time increase versus 13.2. I testing separately by running fresh Docker Hub Postgres 13.2 and 14 images with the default settings.

Latest version of postgres package: 2.4.1+2

times in ms: image

Interestingly pgbench doesn't see much connection difference if any between 13 and 14.

var conn = PostgreSQLConnection('ServerName', 5432, 'dbname', username: 'user', password: 'password!'); Stopwatch swc = Stopwatch()..start(); await conn.open(); print('connection time:' + swc.elapsedMilliseconds.toString());

The actual query times don't see to have varied much.

I haven't had a chance to dig into the code itself to see if I can figure it out, do you have any ideas in mind what it could be?

isoos commented 2 years ago

This PR did affect how connection happens: https://github.com/isoos/postgresql-dart/pull/6 I haven't done any investigation if it affects connecting times, it would be nice if you could dig into it... Note: please use forked repository to report new issues.

zambetpentru commented 2 years ago

Hi @isoos I would have but it seems like the Issues section is not visible to the public?

https://github.com/isoos/postgresql-dart

isoos commented 2 years ago

@zambetpentru: thanks, I haven't noticed that. Enabled now :)

zambetpentru commented 1 year ago

I believe this is due to the different authentication type. Not an issue when using the connection pool :-)