diff options
author | Kuan-Wei Chiu <visitorckw@gmail.com> | 2023-10-13 20:57:14 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-10-19 15:18:59 +0300 |
commit | e08c43e6c3eb5d805b61d981f1e8286ee0dc6d1a (patch) | |
tree | fd1b030343cc7855fe548b1162727136b6ab4c7b /scripts/gdb/linux/utils.py | |
parent | d45c4b48dafb5820e5cc267ff9a6d7784d13a43c (diff) | |
download | linux-e08c43e6c3eb5d805b61d981f1e8286ee0dc6d1a.tar.xz |
powerpc/perf: Optimize find_alternatives_list() using binary search
This patch improves the performance of event alternative lookup by
replacing the previous linear search with a more efficient binary
search. This change reduces the time complexity for the search process
from O(n) to O(log(n)). A pre-sorted table of event values and their
corresponding indices has been introduced to expedite the search
process.
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
[mpe: Call the array "presort*ed*_event_table", minor formatting]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231013175714.2142775-1-visitorckw@gmail.com
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions