Re: NUMERIC type benchmarks

Поиск
Список
Период
Сортировка
От Mario Weilguni
Тема Re: NUMERIC type benchmarks
Дата
Msg-id 01041510421900.00656@wotan
обсуждение исходный текст
Ответ на NUMERIC type benchmarks  (Mark Butler <butlerm@middle.net>)
Список 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.weilguni@kpnqwest.com
===================================================


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Werachart Jantarataeme
Дата:
Сообщение: How to do the modular test
Следующее
От: Sergio Pili
Дата:
Сообщение: SQL