Re: Efficient output for integer types - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Efficient output for integer types
Date
Msg-id E024B828-A33F-451A-AFE0-F1C98A4F8F7C@yandex-team.ru
Whole thread Raw
In response to Efficient output for integer types  (David Fetter <david@fetter.org>)
Responses Re: Efficient output for integer types
List 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.


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Efficient output for integer types
Next
From: Dean Rasheed
Date:
Subject: Re: BF failure: could not open relation with OID XXXX while querying pg_views