Skip to content

Consider optimizations to reduce the number of host calls #6

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

Open
lukewagner opened this issue Mar 4, 2023 · 1 comment
Open

Consider optimizations to reduce the number of host calls #6

lukewagner opened this issue Mar 4, 2023 · 1 comment

Comments

@lukewagner
Copy link
Member

While host calls are pretty fast these days, it's still useful to consider optimizations to reduce their number per request for really low-latency scenarios. This has come up in two areas so far:

  • @PiotrSikora mentioned in this comment that many requests have empty bodies, so perhaps consume could short-circuit the hop through incoming-stream, maybe with a variant like this.
  • @brendandburns mentioned in this comment the sequence of calls to create headers, then create a response, then make the request. Perhaps we could have some more one-shot options that do multiple of these at once.

Both seem like potentially good ideas to me but I'd be happy to hear more thoughts.

@brendandburns
Copy link
Contributor

fwiw, part of the motivation to reduce host calls is also to improve the security of the surface area. I believe it is easier to ensure the security of a single req(...) style call vs all of the memory manipulation of the various calls between guest and host.

It's also a cleaner abstraction for the implementor, so fewer bugs in the implementation.

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

2 participants