Re: pgbench - add pseudo-random permutation function

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: hironobu@interdb.jp, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-09-26T11:20:49Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. pgbench: Function to generate random permutations.

  2. Add basic support for using the POPCNT and SSE4.2s LZCNT opcodes

  3. Further improve code for probing the availability of ARM CRC instructions.

Hello,

> That is necessary because most people consume PostgreSQL through
> packages from distributions that have to work on an Athlon II or
> whatever, so we can't just use -msse4.2 for every translation unit.
> So it becomes our job to isolate small bits of code that use newer
> instructions, if it's really worth the effort to do that, and supply
> our own runtime checks and provide a fallback.

Ok. That was my understanding so as to improve the portability/performance 
compromise. I do not think that pgbench is worth the effort on this 
particular point.

> [...] None of that seems worth it for something like this.

Indeed.

So, am I right to deducing that you are satisfied with the current status 
of the patch, with the nbits implementation either based on popcount (v4) 
or clz (v5) compiler intrinsics? I think that the clz option is better.

-- 
Fabien.