Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Custom code int(32|64) => text conversions out of performance reasons
Date: 2010-12-03 12:31:56
Message-ID: 828w07rq9v.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane:

> Yeah. You certainly don't want to do the division sequence twice,
> and a log() call wouldn't be cheap either, and there don't seem to
> be many other alternatives.

What about a sequence of comparisons, and unrolling the loop? That
could avoid the final division, too. It might also be helpful to
break down the dependency chain for large input values.

The int8 version should probably work in 1e9 chunks and use a
zero-padding variant of the 32-bit code.

--
Florian Weimer <fweimer(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstraße 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergio Lifschitz 2010-12-03 12:44:36 Re: Hypothetical Indexes - PostgreSQL extension - PGCON 2010
Previous Message Alexey Klyukin 2010-12-03 12:27:11 Re: Another proposal for table synonyms