Re: Speed up collation cache

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Speed up collation cache
Date: 2024-07-27 22:14:56
Message-ID: e8d8c09e-7dc6-4306-bbb8-279dd24acaeb@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/26/24 11:00 PM, Jeff Davis wrote:
> Results (in ms):
>
> "C" "libc_c" overhead
> master: 6350  7855 24%
> v4-0001: 6091 6324 4%

I got more overhead in my quick benchmarking when I ran the same
benchmark. Also tried your idea with caching the last lookup (PoC patch
attached) and it basically removed all overhead, but I guess it will not
help if you have two different non.default locales in the same query.

"C" "libc_c" overhead
before: 6695 8376 25%
after: 6605 7340 11%
cache last: 6618 6677 1%

But even without that extra optimization I think this patch is worth
merging and the patch is small, simple and clean and easy to understand
and a just a clear speed up. Feels like a no brainer. I think that it is
ready for committer.

And then we can discuss after committing if an additional cache of the
last locale is worth it or not.

Andreas

Attachment Content-Type Size
0001-WIP-Ugly-caching-of-last-locale.patch text/x-patch 1.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-07-27 22:28:23 Re: Fix overflow in pg_size_pretty
Previous Message Joseph Koshakow 2024-07-27 21:16:38 Re: Fix overflow in pg_size_pretty