Re: Optimize WindowAgg's use of tuplestores
Andy Fan <zhihuifan1213@163.com>
From: Andy Fan <zhihuifan1213@163.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>, David Rowley <dgrowley@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2024-07-18T07:55:42Z
Lists: pgsql-hackers
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> writes: > On Fri, Jul 12, 2024 at 11:59 AM Ashutosh Bapat > <ashutosh.bapat.oss@gmail.com> wrote: >> >> > Out of curiosity, I measured the performance with just the "unlikely" > change and with the full patch. Below are the results > Testing with 1000000 partitions ... > latency average = 333.538 ms > > with just unlikely change > Testing with 1000000 partitions .. > Testing with 1 partitions > > There's noticeable change across all the number of partitions with > just "unlikely" change. I'm curious about why a 'unlikey' change can cause noticeable change, especially there is just one function call in the 'if-statement' (I am thinking more instrucments in the if-statement body, more changes it can cause). + if (unlikely(winstate->buffer == NULL)) + prepare_tuplestore(winstate); -- Best Regards Andy Fan
Commits
-
Optimize WindowAgg's use of tuplestores
- 908a968612f9 18.0 landed
-
Speedup WindowAgg code by moving uncommon code out-of-line
- 19b861f88016 18.0 landed
-
Improve memory management and performance of tuplestore.c
- 590b045c37aa 18.0 cited