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

Re: FunctionCallN improvement.

From: Mike Rylander <mrylander(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>, Neil Conway <neilc(at)samurai(dot)com>,pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FunctionCallN improvement.
Date: 2005-02-02 02:11:08
Message-ID: b918cf3d05020118116c81b5b5@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Sorry, forgot the compiler version.

gcc (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)

On Wed, 2 Feb 2005 01:12:04 +0000, Mike Rylander <mrylander(at)gmail(dot)com> wrote:
> On Tue, 01 Feb 2005 16:23:56 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp> writes:
> > > I made the test program to measure the effect of this macro.
> >
> > Well, if we're going to be tense about this, let's actually be tense
> > about it.  Your test program isn't a great model for what's going to
> > happen in fmgr.c, because you've designed it so that Nargs cannot be
> > known at compile time.  In the fmgr routines, Nargs is certainly a
> > compile-time constant, and so implementations that can exploit that
> > will have an advantage.
> >
> 
> <big snip>
> 
> Here are some numbers for AMD64 (gcc -O2 -I
> /opt/include/postgresql/server/ pg_test.c -o pg_test):
> 
> miker(at)weezie miker $ time ./pg_test -memset 1000000000
> test MemSetLoop(2): 1000000000
> 
> real    1m15.896s
> user    1m15.881s
> sys     0m0.006s
> miker(at)weezie miker $ time ./pg_test -origmacro 1000000000
> test OrigMacro(2): 1000000000
> 
> real    0m4.217s
> user    0m4.215s
> sys     0m0.001s
> miker(at)weezie miker $ time ./pg_test -setmacro 1000000000
> test SetMacro(2): 1000000000
> 
> real    0m4.217s
> user    0m4.216s
> sys     0m0.001s
> miker(at)weezie miker $ time ./pg_test -unrolled 1000000000
> test Unrolled(2): 1000000000
> 
> real    0m4.218s
> user    0m4.215s
> sys     0m0.002s
> 
> and now with -O6:
> 
> miker(at)weezie miker $ time ./pg_test -memset 1000000000
> test MemSetLoop(2): 1000000000
> 
> real    1m13.624s
> user    1m13.542s
> sys     0m0.001s
> miker(at)weezie miker $ time ./pg_test -origmacro 1000000000
> test OrigMacro(2): 1000000000
> 
> real    0m2.929s
> user    0m2.926s
> sys     0m0.001s
> miker(at)weezie miker $ time ./pg_test -setmacro 1000000000
> test SetMacro(2): 1000000000
> 
> real    0m2.929s
> user    0m2.926s
> sys     0m0.000s
> miker(at)weezie miker $ time ./pg_test -unrolled 1000000000
> test Unrolled(2): 1000000000
> 
> real    0m2.510s
> user    0m2.508s
> sys     0m0.001s
> 
> Now with NARGS = 5, -O2:
> 
> miker(at)weezie miker $ time ./pg_test -memset 1000000000
> test MemSetLoop(5): 1000000000
> 
> real    1m15.204s
> user    1m15.175s
> sys     0m0.002s
> miker(at)weezie miker $ time ./pg_test -origmacro 1000000000
> test OrigMacro(5): 1000000000
> 
> real    0m10.027s
> user    0m10.022s
> sys     0m0.001s
> miker(at)weezie miker $ time ./pg_test -setmacro 1000000000
> test SetMacro(5): 1000000000
> 
> real    0m4.177s
> user    0m4.177s
> sys     0m0.000s
> miker(at)weezie miker $ time ./pg_test -unrolled 1000000000
> test Unrolled(5): 1000000000
> 
> real    0m5.013s
> user    0m5.011s
> sys     0m0.000s
> 
> And once more, with -O6:
> 
> miker(at)weezie miker $ time ./pg_test -memset 1000000000
> test MemSetLoop(5): 1000000000
> 
> real    1m47.090s
> user    1m46.972s
> sys     0m0.000s
> miker(at)weezie miker $ time ./pg_test -origmacro 1000000000
> test OrigMacro(5): 1000000000
> 
> real    0m8.367s
> user    0m8.358s
> sys     0m0.000s
> miker(at)weezie miker $ time ./pg_test -setmacro 1000000000
> test SetMacro(5): 1000000000
> 
> real    0m3.349s
> user    0m3.345s
> sys     0m0.000s
> miker(at)weezie miker $ time ./pg_test -unrolled 1000000000
> test Unrolled(5): 1000000000
> 
> real    0m3.347s
> user    0m3.343s
> sys     0m0.000s
> 
> 
> Hope the numbers help!
> 
> --
> Mike Rylander
> mrylander(at)gmail(dot)com
> GPLS -- PINES Development
> Database Developer
> http://open-ils.org
> 


-- 
Mike Rylander
mrylander(at)gmail(dot)com
GPLS -- PINES Development
Database Developer
http://open-ils.org

In response to

pgsql-hackers by date

Next:From: Greg Sabino MullaneDate: 2005-02-02 03:49:52
Subject: Re: Continue transactions after errors in psql
Previous:From: John HansenDate: 2005-02-02 01:39:21
Subject: Re: [NOVICE] Last ID Problem

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