Introduce optimized routine for linear searches of arrays

John Naylor <john.naylor@postgresql.org>

Commit: b6ef167564905e8dab8af1b1dba0997ec61204ca
Author: John Naylor <john.naylor@postgresql.org>
Date: 2022-08-10T03:48:29Z
Releases: 16.0
Introduce optimized routine for linear searches of arrays

Use SSE2 intrinsics to speed up the search, where available.  Otherwise,
use a simple 'for' loop.  The motivation to add this now is to speed up
XidInMVCCSnapshot(), which is the reason only unsigned 32-bit integer
arrays are optimized. Other types are left for future work, as is the
extension of this technique to non-x86 platforms.

Nathan Bossart

Reviewed by: Andres Freund, Bharath Rupireddy, Masahiko Sawada
Discussion: https://postgr.es/m/20220713170950.GA3116318%40nathanxps13

Files

Discussion