Re: speed up unicode decomposition and recomposition - Mailing list pgsql-hackers

From John Naylor
Subject Re: speed up unicode decomposition and recomposition
Date
Msg-id CAFBsxsFwu0w4TNK+UnCfnzsi2nGKkG3LBKXCPCjDJBXg6iZpjw@mail.gmail.com
Whole thread Raw
In response to Re: speed up unicode decomposition and recomposition  (Michael Paquier <michael@paquier.xyz>)
Responses Re: speed up unicode decomposition and recomposition
List pgsql-hackers
Attached v3 addressing review points below:

On Thu, Oct 15, 2020 at 11:32 PM Michael Paquier <michael@paquier.xyz> wrote:
+   # Then the second
+   return -1 if $a2 < $b2;
+   return 1 if $a2 > $b2;
Should say "second code point" here?

Done. Also changed the tiebreaker to the composed codepoint. Beforehand, it was the index into DecompMain[], which is only equivalent if the list is in order (it is but we don't want correctness to depend on that), and not very clear.
 
+       hashkey = pg_hton64(((uint64) start << 32) | (uint64) code);
+       h = recompinfo.hash(&hashkey);
This choice should be documented, and most likely we should have
comments on the perl and C sides to keep track of the relationship
between the two.

Done.
 
<separate headers>

Done. 

Other cosmetic changes:
- format recomp array comments like /* U+0045+032D -> U+1E18 */
- make sure to comment #endif's that are far from the #if
- small whitespace fixes

Note: for the new header I simply adapted from unicode_norm_table.h the choice of "There is deliberately not an #ifndef PG_UNICODE_NORM_TABLE_H here", although I must confess I'm not sure what the purpose of that is, in this case.

--
John Naylor
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company 
Attachment

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: [DOC] Document concurrent index builds waiting on each other
Next
From: Tom Lane
Date:
Subject: Mop-up around psql's \connect behavior