Re: NUMERIC type benchmarks

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Mark Butler <butlerm(at)middle(dot)net>
Subject: Re: NUMERIC type benchmarks
Date: 2001-04-15 08:42:19
Message-ID: 01041510421900.00656@wotan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Am Freitag, 13. April 2001 23:16 schrieben Sie:
> Tom Lane wrote:
> > A more significant point is that you have presented no evidence to back
> > up your claim that this would be materially faster than the existing
> > type. I doubt that the extra pallocs are all that expensive. (I think
> > it'd be far more helpful to reimplement numeric using base-10000
> > representation --- four decimal digits per int16 --- and then eliminate
> > the distinction between storage format and computation format. See past
> > discussions in the pghackers archives.)
>
> I did several tests with functions designed to sum the number 12345 a
> million times. The results are as follows (Pentium II 450, Redhat 6.2):
>
> Postgres PL/PGSQL original numeric: 14.8 seconds
> Postgres PL/PGSQL modified numeric: 11.0 seconds
> Postgres PL/PGSQL float8: 10.7 seconds
> GNU AWK: 2.5 seconds
> Oracle PL/SQL number: 2.0 seconds
>
> The modified Postgres numeric type is the original source code modified to
> use a 32 digit NumericVar attribute digit buffer that eliminates
> palloc()/pfree() calls when ndigits < 32.
>
> Surely those are performance differences worth considering...

I tested that on a similar configuration (P-III 450) and got the same
results. When the addition is removed from the loop and replaced with a
simple assignment, the total execution time goes down to ~6.5 seconds. That
means that the modified numeric is nearly twice as fast, sure worth
considering that.

--
===================================================
Mario Weilguni                 KPNQwest Austria GmbH
 Senior Engineer Web Solutions Nikolaiplatz 4
 tel: +43-316-813824         8020 graz, austria
 fax: +43-316-813824-26       http://www.kpnqwest.at
 e-mail: mario(dot)weilguni(at)kpnqwest(dot)com
===================================================

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karl DeBisschop 2001-04-15 10:59:54 Re: Re: 7.1 RPMs
Previous Message Werachart Jantarataeme 2001-04-15 07:05:16 How to do the modular test