Skip to main content

Posts

Showing posts with the label NpgsqlConnection

Performance improvements when creating NpgsqlConnection objects

Recently,  I applied a patch from  Kevin Pullin  which will improve the performance of programs using Npgsql. This patch reduces significantly the time to create new NpgsqlConnection objects. This particularly applies in scenarios where you are creating and disposing a lot of NpgsqlConnection objects, like when  you are using connection pool , ( you are using it, right? :) ). Comparison test I made an artificial test to show the impact of this patch. This test consists of a simple loop where I create 10k NpgsqlConnection objects.  class   Program     {          static   void   Main ( string []  args )         {              var   connString   =   "server=127.0.0.1;userid=npgsql_tests;database=npgsql_tests;" ;        ...