0
votes

I want to connect to a PostgreSQL 9.6 Database using Npgsql. For this I need to create a Connection, but the constructor is extremely slow.

Connection = new NpgsqlConnection();

The constructor needs about 4.8 seconds to complete. Why? Passing a connection string into the constructor has no positive effect either.

I am using Vistual Studio 2015 Community and Npgsql 3.2.1

1

1 Answers

1
votes

See https://github.com/npgsql/npgsql/issues/1435.

Npgsql 3.2 introduced performance counter support, but their one-time initialization sometimes causes slowdowns and exceptions. This feature has already been made opt-in, so 3.2.2 will no longer have this problem.