Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9AFF49FB1DA for ; Mon, 29 Jan 2007 08:38:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 42412-02 for ; Mon, 29 Jan 2007 08:38:34 -0400 (AST) X-Greylist: delayed 00:15:58.994056 by SQLgrey-1.7.4 Received: from viefep22-int.chello.at (viefep13-int.chello.at [213.46.255.15]) by postgresql.org (Postfix) with ESMTP id 9886D9F93A2 for ; Mon, 29 Jan 2007 08:38:37 -0400 (AST) Received: from slim.softnrg.dnttm.ro ([86.35.52.221]) by viefep21-int.chello.at (InterMail vM.6.01.05.04 201-2131-123-105-20051025) with ESMTP id <20070129122235.FBLS5530.viefep21-int.chello.at@slim.softnrg.dnttm.ro> for ; Mon, 29 Jan 2007 13:22:35 +0100 Received: (qmail 10402 invoked from network); 29 Jan 2007 14:22:34 +0200 Received: from andi.softnrg.dnttm.ro (HELO ?192.213.1.59?) (192.213.1.59) by slim.softnrg.dnttm.ro with SMTP; 29 Jan 2007 14:22:34 +0200 Received: from 127.0.0.1 (AVG SMTP 7.1.410 [268.17.12/655]); Mon, 29 Jan 2007 14:22:38 +0200 Message-ID: <45BDE70E.7050100@softnrg.dnttm.ro> Date: Mon, 29 Jan 2007 14:22:38 +0200 From: Andrei Gaspar User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) To: pgsql-odbc@postgresql.org Subject: Driver optimization Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=------------020305000501070604010603 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/71 X-Sequence-Number: 8610 --------------020305000501070604010603 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, I used the psqlodbc driver and did a little profiling for the speed. It turns out that the memory management is very slow, using malloc from the crt. I have found another implementation of malloc, at http://gee.cs.oswego.edu/dl/html/malloc.html source code at ftp://g.oswego.edu/pub/misc/malloc.c This version is in the public domain and could be included in the project. The performance increase is dramatic. If the changes are OK, please commit them to the official cvs Just add the malloc.c to the project, define the symbols USE_DL_PREFIX and USE_LOCKS=1 and add the following code to psqlodbc.h: #ifdef USE_DL_PREFIX void * __cdecl dlcalloc(size_t, size_t); void __cdecl dlfree(void *); void * __cdecl dlmalloc(size_t); void * __cdecl dlrealloc(void *, size_t); char * __cdecl dlstrdup (const char *); #undef malloc #undef realloc #undef calloc #undef free #define malloc dlmalloc #define realloc dlrealloc #define calloc dlcalloc #define free dlfree #endif /* USE_DL_PREFIX */ Andrei Gaspar --------------020305000501070604010603 Content-Type: text/plain; name=psqlodbc.h.diff Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="psqlodbc.h.diff" 485a486,504 > #ifdef USE_DL_PREFIX > void * __cdecl dlcalloc(size_t, size_t); > void __cdecl dlfree(void *); > void * __cdecl dlmalloc(size_t); > void * __cdecl dlrealloc(void *, size_t); > > #undef malloc > #undef realloc > #undef calloc > //#undef strdup > #undef free > > #define malloc dlmalloc > #define realloc dlrealloc > #define calloc dlcalloc > //#define strdup dlstrdup > #define free dlfree > #endif /* USE_DL_PREFIX */ > --------------020305000501070604010603 Content-Type: text/plain; x-avg=cert; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: "AVG certification" No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.410 / Virus Database: 268.17.12/655 - Release Date: 1/28/2007 --------------020305000501070604010603--