[database-devel] Announcing postgresql-libpq-0.8.2.3

Leon Smith leon.p.smith at gmail.com
Tue Jul 9 03:03:09 CEST 2013


I just fixed a fairly serious performance problem with postgresql-libpq's
binding to PQescapeStringConn;   in was exhibiting a non-linear slowdown
when more strings are escaped and retained.

https://github.com/lpsmith/postgresql-libpq/commit/adf32ff26cdeca0a12fa59653b49c87198acc9ae

If you are using postgresql-libpq's escapeStringConn,  or a library that
uses it (e.g.  postgresql-simple,  or persistent-postgresql),  I do
recommend upgrading.   You may or may not see a performance improvement,
 depending on your particular use case,   but if you do it can be quite
substantial.

It's not entirely clear to me what the root cause really is,  but it
certainly appears as though it's related to the (direct) use of
mallocBytes,   which was replaced with (indirect) calls to
mallocForeignPtrBytes / mallocPlainForeignPtrBytes (through the bytestring
package).   In this case,  it resulted in an asymptotic improvement in time
complexity of some algorithms.

Best,
Leon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/database-devel/attachments/20130708/12bb1799/attachment.htm>


More information about the database-devel mailing list