Friday, November 28, 2008

NpgsqlCommand optimizations and usage tip


Hi, all!

Some days ago, I fixed a slow performance problem with Npgsql when calling functions. The problem was that Npgsql was doing a lot of expensive checks (in fact, 3) to verify parameter information and return type. The solution was to cache those checks so that new calls to the same function don't need to pass through the same checks again.

In order to not have problems with outdated caches and etc and after talking to Josh on gmail, I decided to make the cache local and it would be invalidated as soon as the command text is changed.

This semantics lead me to write this blog to share the idea that you can get a big performance improvement if you "cache" your NpgsqlCommands which will be used with function calls. This way, instead of creating and releasing the command object after its usage, you can create all your NpgsqlCommand objects associated to function calls and reuse them as needed. This way you pay for the costly checks only once.

I hope this tip can help people to get some performance gains from this fix. :)

Tuesday, November 04, 2008

Npgsql2 2.0.1 released!

Hi, all!

Npgsql Development Team has just released Npgsql2 2.0.1.

This is a minor bug fix release with highlights to entity framework fixes.

Check out release notes for more information.

You can grab it from the usual location: http://downloads.npgsql.org

Enjoy.