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

Investigate performance improvements #152

Open
sosthene-nitrokey opened this issue Apr 27, 2023 · 0 comments
Open

Investigate performance improvements #152

sosthene-nitrokey opened this issue Apr 27, 2023 · 0 comments

Comments

@sosthene-nitrokey
Copy link
Collaborator

Running opgpcard status and gpg --card-status is pretty slow compared to other implementations. This is likely why #144 only affects us.

Supposition:

TLV

TLV serialization often doesn't make assumption about the size of the inner data, so the data in the buffer ends up being moved around (see Reply::prepend_len)

Interchange syscall overhead

Data outside and inside the interchange is copied around all the time. It's first constructed on the stack, then it's copied into the interchange. When it's read, the opposite happens, it's copied on the stack.
The solution would likely be to use references. We can build the data in place with Requester::with_request_mut and Responder::with_response_mut. We can also avoid unnecessary copies by reading the response by using a reference rather than copying it on the stack.

apdu_dispatch, usbd-ccid overhead

Currently there are multiple places where data is buffered and placed into interchanges. Ideally the use of interchanges should be minimal.

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

No branches or pull requests

1 participant