pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Daniel Verite <daniel@manitou-mail.org>
Subject: Re: ICU for global collation
Date: Mon, 10 Jan 2022 14:00:27 +0800
Message-ID: <20220110060027.egvaly4lskylo22f@jrouhaud> (raw)
In-Reply-To: <20220110032508.4eyz6m6mpvt622la@jrouhaud>
References: <374f8048-9d87-462c-a8aa-d02ffca6525f@manitou-mail.org>
	<d7060bf1-177c-e0f2-f13f-b857cdd1182e@2ndquadrant.com>
	<525ef44f-52bf-505f-a491-07835d039424@enterprisedb.com>
	<YdOvEAFGbfGY/47A@jrouhaud>
	<bba413de-5548-3480-e8f8-1ced562a866b@enterprisedb.com>
	<ed3baa81-7fac-7788-cc12-41e3f7917e34@enterprisedb.com>
	<20220110032508.4eyz6m6mpvt622la@jrouhaud>

On Mon, Jan 10, 2022 at 11:25:08AM +0800, Julien Rouhaud wrote:
> On Fri, Jan 07, 2022 at 03:25:28PM +0100, Peter Eisentraut wrote:
> > 
> > I tested this a bit.  I used the following setup:
> > 
> > create table t1 (a text);
> > insert into t1 select md5(generate_series(1, 10000000)::text);
> > select count(*) from t1 where a > '';
> > 
> > And then I changed in varstr_cmp():
> > 
> >         if (collid != DEFAULT_COLLATION_OID)
> >             mylocale = pg_newlocale_from_collation(collid);
> > 
> > to just
> > 
> >         mylocale = pg_newlocale_from_collation(collid);
> > 
> > I find that the \timing results are indistinguishable.  (I used locale
> > "en_US.UTF-8" and made sure that that code path is actually hit.)
> > 
> > Does anyone have other insights?
> 
> Looking at the git history, you added this comment in 414c5a2ea65.
> 
> After a bit a digging in the lists, I found that you introduced it to fix a
> reported 13% slowdown in varstr_cmp():
> https://www.postgresql.org/message-id/20110129075253.GA18784%40tornado.leadboat.com
> https://www.postgresql.org/message-id/1296748408.6442.1.camel%40vanquo.pezone.net

So I tried to run Noah's benchmark to see if I could reproduce the slowdown.
Unfortunately the results I'm getting don't really make sense as removing the
optimisation brings a 15% speedup, and with a few more runs I can see that I
have about 25% noise, so there isn't much I can do to help.





view thread (111+ messages)  latest in thread

Message-ID: <20220110060027.egvaly4lskylo22f@jrouhaud>
Permalink:  ../20220110060027.egvaly4lskylo22f@jrouhaud/
Also on:    postgresql.org/message-id/20220110060027.egvaly4lskylo22f@jrouhaud

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: rjuju123@gmail.com, peter.eisentraut@enterprisedb.com, daniel@manitou-mail.org
  Subject: Re: ICU for global collation
  In-Reply-To: <20220110060027.egvaly4lskylo22f@jrouhaud>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox