Re: Efficient output for integer types

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: David Fetter <david@fetter.org>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2019-09-15T09:06:29Z
Lists: pgsql-hackers

> 15 сент. 2019 г., в 12:18, David Fetter <david@fetter.org> написал(а):
> 
> Please find attached a couple of patches intended to $subject.
> 
> This patch set cut the time to copy ten million rows of randomly sized
> int8s (10 of them) by about a third, so at least for that case, it's
> pretty decent.

Hi! Looks cool.

Just curious if for any fixed base and square here

+		while(uvalue >= base)
 		{
+			const int i = (uvalue % square) * 2;
+			uvalue /= square;
+			vallen += 2;
+			memcpy(convert + sizeof(convert) - vallen, digits + i, 2);
+		}

compiler will have a chance to avoid idiv instruction?
Maybe few specialized functions could work better than generic algorithm?

Best regards, Andrey Borodin.


Commits

  1. Optimizations for integer to decimal output.