Skip site navigation (1) Skip section navigation (2)

Driver optimization

From: Andrei Gaspar <andi(at)softnrg(dot)dnttm(dot)ro>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Driver optimization
Date: 2007-01-29 12:22:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
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
I have found another implementation of malloc, at
source code at

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

Attachment: psqlodbc.h.diff
Description: text/plain (449 bytes)

pgsql-odbc by date

Next:From: Ian KlassenDate: 2007-01-29 15:07:30
Subject: Re: Problems with MFC AddNew
Previous:From: Dave PageDate: 2007-01-29 10:33:04
Subject: Updatable cursors - applications?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group