Re: [PATCH 5/5] lib/list_sort: Optimize number of calls to comparison function

2019-06-21 Thread Rasmus Villemoes
On 14/03/2019 02.58, George Spelvin wrote: > On Thu, 14 Mar 2019 at 00:28:16 +0100, Rasmus Villemoes wrote: >> Similarly one could do a SORT_SIMPLE_CMP() for when sorting an array of >> structs according to a single numeric member. That sort is not stable, >> so the comparison functions would

Re: [PATCH 5/5] lib/list_sort: Optimize number of calls to comparison function

2019-03-13 Thread George Spelvin
On Thu, 14 Mar 2019 at 00:28:16 +0100, Rasmus Villemoes wrote: > On 05/03/2019 06.58, George Spelvin wrote: >> This patch avoids badly unbalanced merges on unlucky input sizes. >> It slightly increases the code size, but saves an average of 0.2*n >> calls to cmp(). >> > [snip] >> >> (I confess

Re: [PATCH 5/5] lib/list_sort: Optimize number of calls to comparison function

2019-03-13 Thread Rasmus Villemoes
On 05/03/2019 06.58, George Spelvin wrote: > CONFIG_RETPOLINE has severely degraded indirect function call > performance, so it's worth putting some effort into reducing > the number of times cmp() is called. > > This patch avoids badly unbalanced merges on unlucky input sizes. > It slightly

[PATCH 5/5] lib/list_sort: Optimize number of calls to comparison function

2019-03-08 Thread George Spelvin
CONFIG_RETPOLINE has severely degraded indirect function call performance, so it's worth putting some effort into reducing the number of times cmp() is called. This patch avoids badly unbalanced merges on unlucky input sizes. It slightly increases the code size, but saves an average of 0.2*n