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

map: don't unmarshal unnecessary items on batch lookup #1080

Open
ti-mo opened this issue Jun 27, 2023 · 0 comments
Open

map: don't unmarshal unnecessary items on batch lookup #1080

ti-mo opened this issue Jun 27, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@ti-mo
Copy link
Collaborator

ti-mo commented Jun 27, 2023

It does seem like Map.batchLookup() always tries to unmarshal the whole keyBuf and valueBuf regardless of the Count received from the batch syscall.

ebpf/map.go

Lines 1076 to 1083 in c739d15

err := sysenc.Unmarshal(keysOut, keyBuf)
if err != nil {
return 0, err
}
err = sysenc.Unmarshal(valuesOut, valueBuf)
if err != nil {
return 0, err
}

It would be nice if we instead only decoded count keys and values.

See #1078 (comment).

@lmb lmb changed the title Batch: only unmarshal as much as needed map: don't unmarshal unnecessary items on batch lookup Dec 5, 2023
@lmb lmb added the help wanted Extra attention is needed label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants