Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btf: reduce unnecessary copies when parsing BTF #623

Merged
merged 1 commit into from Apr 13, 2022

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Apr 12, 2022

We currently read all BTF into memory before starting decoding. This is wasteful,
especially for the large-ish string table. Be a bit more clever to remove intermediate
copies.

name            old time/op    new time/op    delta
ParseVmlinux-4     107ms ± 7%      77ms ±13%  -27.98%  (p=0.029 n=4+4)

name            old alloc/op   new alloc/op   delta
ParseVmlinux-4     119MB ± 0%      93MB ± 0%  -22.20%  (p=0.029 n=4+4)

name            old allocs/op  new allocs/op  delta
ParseVmlinux-4      786k ± 0%      786k ± 0%   -0.01%  (p=0.029 n=4+4)

We currently read all BTF into memory before starting decoding. This is wasteful,
especially for the large-ish string table. Be a bit more clever to remove intermediate
copies.

    name            old time/op    new time/op    delta
    ParseVmlinux-4     107ms ± 7%      77ms ±13%  -27.98%  (p=0.029 n=4+4)

    name            old alloc/op   new alloc/op   delta
    ParseVmlinux-4     119MB ± 0%      93MB ± 0%  -22.20%  (p=0.029 n=4+4)

    name            old allocs/op  new allocs/op  delta
    ParseVmlinux-4      786k ± 0%      786k ± 0%   -0.01%  (p=0.029 n=4+4)
@lmb lmb requested a review from ti-mo April 12, 2022 04:44
@ti-mo ti-mo merged commit 25a3974 into cilium:master Apr 13, 2022
@lmb lmb deleted the btf-reduce-copies branch February 27, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants