X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 28BB69FB0D1 for ; Thu, 11 May 2006 19:49:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 99303-10 for ; Thu, 11 May 2006 19:49:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from joeconway.com (wsip-68-15-9-201.sd.sd.cox.net [68.15.9.201]) by postgresql.org (Postfix) with ESMTP id 0EE749FADD1 for ; Thu, 11 May 2006 19:49:47 -0300 (ADT) Received: from [206.190.70.130] (account jconway HELO [172.16.1.115]) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 3708488; Thu, 11 May 2006 15:50:09 -0700 Message-ID: <4463BF89.6050702@joeconway.com> Date: Thu, 11 May 2006 15:49:45 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.13) Gecko/20060501 Fedora/1.7.13-1.1.fc5 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Jim C. Nasby" CC: Adam Palmblad , pgsql-performance@postgresql.org Subject: Re: Dynamically loaded C function performance References: <6B5AF6293A289F45826220B17ABE79370D5ED7@BORON.aers.local> <20060511220523.GT99570@pervasive.com> In-Reply-To: <20060511220523.GT99570@pervasive.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/310 X-Sequence-Number: 19097 Jim C. Nasby wrote: > On Fri, May 05, 2006 at 03:47:53PM -0700, Adam Palmblad wrote: > >>Hi, >>We've got a C function that we use here and we find that for every >>connection, the first run of the function is much slower than any >>subsequent runs. ( 50ms compared to 8ms) >> >>Besides using connection pooling, are there any options to improve >>performance? > > In my experience, connection startup takes a heck of a lot longer than > 50ms, so why are you worrying about 50ms for the first run of a > function? > > BTW, sorry, but I don't know a way to speed this up, either. I think Tom nailed the solution already in a nearby reply -- see preload_libraries on this page: http://www.postgresql.org/docs/8.1/interactive/runtime-config-resource.html Joe