Re: realloc suggestion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: realloc suggestion
Date
Msg-id 23742.980211975@sss.pgh.pa.us
Whole thread Raw
In response to realloc suggestion  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: realloc suggestion  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
Karel Zak <zakkr@zf.jcu.cz> writes:
>  I again a little look at aset code and I probably found small performance 
> reserve in small chunks (chunk <= ALLOC_CHUNK_LIMIT) reallocation.

Hmm.  I wouldn't have thought that realloc got called often enough to be
worth optimizing, but it does seem to get called a few hundred times
during the regress tests, so maybe it's worth a little more code to do
this.  (Looks like most of the realloc calls come from enlargeStringInfo
while dealing with long query strings --- since in this case the string
buffer is the only thing yet allocated in QueryContext, the special-case
check wins.)

I've committed this change.  Thanks for the suggestion!
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: drop table and pg_proc
Next
From: Bruce Momjian
Date:
Subject: Re: AW: AW: Could turn on -O2 in AIX