Re: [PATCH bpf-next v10 04/13] libbpf: Optimize type lookup with binary search for sorted BTF
From: Eduard Zingerman
Date: Thu Dec 18 2025 - 14:32:06 EST
On Thu, 2025-12-18 at 19:30 +0800, Donglin Peng wrote:
> From: pengdonglin <pengdonglin@xxxxxxxxxx>
>
> This patch introduces binary search optimization for BTF type lookups
> when the BTF instance contains sorted types.
>
> The optimization significantly improves performance when searching for
> types in large BTF instances with sorted types. For unsorted BTF, the
> implementation falls back to the original linear search.
>
> Cc: Eduard Zingerman <eddyz87@xxxxxxxxx>
> Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
> Cc: Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx>
> Cc: Alan Maguire <alan.maguire@xxxxxxxxxx>
> Cc: Ihor Solodrai <ihor.solodrai@xxxxxxxxx>
> Cc: Xiaoqin Zhang <zhangxiaoqin@xxxxxxxxxx>
> Signed-off-by: pengdonglin <pengdonglin@xxxxxxxxxx>
> ---
Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>
[...]