Re: [PATCH v1 1/2] perf comm str: Avoid sort during insert
From: Matt Fleming
Date: Wed Jul 03 2024 - 13:35:48 EST
On Wed, Jul 3, 2024 at 6:21 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> The array is sorted, so just move the elements and insert in order.
>
> Reported-by: Matt Fleming <matt@xxxxxxxxxxxxxxxx>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> ---
> tools/perf/util/comm.c | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
Thanks, this fixes the issue I had where perf-top would spend >40% of
its time sorting comm_strs.
Tested-by: Matt Fleming <matt@xxxxxxxxxxxxxxxx>