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

pgsql: Marginal performance hack: remove the loop that used to be needed

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Marginal performance hack: remove the loop that used to be needed
Date: 2007-04-30 00:12:08
Message-ID: 20070430001208.53EC69FA4DD@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Marginal performance hack: remove the loop that used to be needed to
look through a freelist for a chunk of adequate size.  For a long time
now, all elements of a given freelist have been exactly the same
allocated size, so we don't need a loop.  Since the loop never iterated
more than once, you'd think this wouldn't matter much, but it makes a
noticeable savings in a simple test --- perhaps because the compiler
isn't optimizing on a mistaken assumption that the loop would repeat.
AllocSetAlloc is called often enough that saving even a couple of
instructions is worthwhile.

Modified Files:
--------------
    pgsql/src/backend/utils/mmgr:
        aset.c (r1.71 -> r1.72)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/aset.c.diff?r1=1.71&r2=1.72)

pgsql-committers by date

Next:From: Tom LaneDate: 2007-04-30 00:14:54
Subject: pgsql: Marginal performance hack: avoid unnecessary work in
Previous:From: Bruce MomjianDate: 2007-04-29 07:17:12
Subject: pgsql: Update to 8.4: < * Make standard_conforming_strings the default

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