Re: wchareq improvement - Mailing list pgsql-patches

From a_ogawa
Subject Re: wchareq improvement
Date
Msg-id PIEMIKOOMKNIJLLLBCBBKEIECHAA.a_ogawa@hi-ho.ne.jp
Whole thread Raw
In response to Re: wchareq improvement  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian wrote:
>
> Patch applied with adjustment --- the second part of your patch that
> skips comparing the first byte seemed unnecessary.  It seemed likely
> to cause a cpu stall, so just doing the loop seemed faster.
>
> Did you test if the second part of your patch actually caused a speedup?

Well, I measured the performance today. As a result, I confirmed the
second part of my patch is unnecessary as you pointed it out.
Thanks for comment and applying patch.

> a_ogawa wrote:
> >
> > In SQL that uses 'like' operator, wchareq is used to compare characters.
> >
> > At the head of wchareq, length of (multibyte) character is compared by
> > using pg_mblen. Therefore, pg_mblen is executed many times, and it
> > becomes a bottleneck.

regards,

--- Atsushi Ogawa


pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Implementation of SQLSTATE and SQLERRM variables
Next
From: Neil Conway
Date:
Subject: Re: O_DIRECT for WAL writes