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

2019-03-19 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

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

2019-03-15 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