Re: optimize several list functions with SIMD intrinsics

2023-07-10 Thread Heikki Linnakangas
On 21/04/2023 23:33, Nathan Bossart wrote: On Fri, Apr 21, 2023 at 01:50:34PM +0700, John Naylor wrote: On Wed, Mar 8, 2023 at 7:25 AM Nathan Bossart wrote: was mostly a fun weekend project, and I don't presently have any concrete examples of workloads where this might help. It seems like th

Re: optimize several list functions with SIMD intrinsics

2023-04-21 Thread Nathan Bossart
On Fri, Apr 21, 2023 at 01:50:34PM +0700, John Naylor wrote: > On Wed, Mar 8, 2023 at 7:25 AM Nathan Bossart > wrote: >> was mostly a fun weekend project, and I don't presently have any concrete >> examples of workloads where this might help. > > It seems like that should be demonstrated before s

Re: optimize several list functions with SIMD intrinsics

2023-04-20 Thread John Naylor
On Wed, Mar 8, 2023 at 7:25 AM Nathan Bossart wrote: > > was mostly a fun weekend project, and I don't presently have any concrete > examples of workloads where this might help. It seems like that should be demonstrated before seriously considering this, like a profile where the relevant list fun

Re: optimize several list functions with SIMD intrinsics

2023-04-17 Thread Nathan Bossart
Here is a new patch set. I've split it into two patches: one for the 64-bit functions, and one for the 32-bit functions. I've also added tests for pg_lfind64/pg_lfind64_idx and deduplicated the code a bit. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 7dbbf61e8a2546a73413c

Re: optimize several list functions with SIMD intrinsics

2023-03-15 Thread Ankit Kumar Pandey
On 15/03/23 21:53, Nathan Bossart wrote: Did you try building without SIMD support? This is what I see: list.c: In function ‘list_member_ptr’: list.c:697:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 697 | const ListCell

Re: optimize several list functions with SIMD intrinsics

2023-03-15 Thread Nathan Bossart
On Wed, Mar 15, 2023 at 07:31:46PM +0530, Ankit Kumar Pandey wrote: >> On 14/03/23 03:10, Nathan Bossart wrote: >> On Sat, Mar 11, 2023 at 09:41:18AM +, Ankit Kumar Pandey wrote: >> > 1. In list_member_ptr, will it be okay to bring `const ListCell >> > *cell` from #ifdef USE_NO_SIMD >> >con

Re: optimize several list functions with SIMD intrinsics

2023-03-15 Thread Ankit Kumar Pandey
Agree with your points Nathan. Just a headup. On 14/03/23 03:10, Nathan Bossart wrote: On Sat, Mar 11, 2023 at 09:41:18AM +, Ankit Kumar Pandey wrote: 1. In list_member_ptr, will it be okay to bring `const ListCell *cell` from #ifdef USE_NO_SIMD const ListCell *cell; #endif to #els

Re: optimize several list functions with SIMD intrinsics

2023-03-13 Thread Nathan Bossart
Thanks for taking a look. On Sat, Mar 11, 2023 at 09:41:18AM +, Ankit Kumar Pandey wrote: > 1. In list_member_ptr, will it be okay to bring `const ListCell *cell` from > #ifdef USE_NO_SIMD > const ListCell *cell; > #endif > to #else like as mentioned below? This will make visual separat

Re: optimize several list functions with SIMD intrinsics

2023-03-11 Thread Ankit Kumar Pandey
> 7. Is it possible to add a benchmark which shows improvement against HEAD ? Please ignore this from my earlier mail, I just saw stats now. Thanks, Ankit

Re: optimize several list functions with SIMD intrinsics

2023-03-11 Thread Ankit Kumar Pandey
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: not tested Spec compliant: not tested Documentation:not tested Hello, Adding some review comments: 1. In list_member_ptr, will it be

Re: optimize several list functions with SIMD intrinsics

2023-03-08 Thread Nathan Bossart
cfbot's Windows build wasn't happy with a couple of casts. I applied a fix similar to c6a43c2 in v2. The patch is still very much a work in progress. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 055717233c47518ae48119938ebd203cc55f7f3c Mon Sep 17 00:00:00 2001 From: Natha

Re: optimize several list functions with SIMD intrinsics

2023-03-07 Thread Nathan Bossart
On Wed, Mar 08, 2023 at 01:54:15PM +1300, David Rowley wrote: > Interesting and quite impressive performance numbers. Thanks for taking a look. > From having a quick glance at the patch, it looks like you'll need to > take some extra time to make it work on 32-bit builds. At the moment, the supp

Re: optimize several list functions with SIMD intrinsics

2023-03-07 Thread David Rowley
On Wed, 8 Mar 2023 at 13:25, Nathan Bossart wrote: > I've attached a work-in-progress patch that implements these optimizations > for both x86 and arm, and I will register this in the July commitfest. I'm > posting this a little early in order to gauge interest. Interesting and quite impressive

optimize several list functions with SIMD intrinsics

2023-03-07 Thread Nathan Bossart
I noticed that several of the List functions do simple linear searches that can be optimized with SIMD intrinsics (as was done for XidInMVCCSnapshot in 37a6e5d). The following table shows the time spent iterating over a list of n elements (via list_member_int) one billion times on my x86 laptop.