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

Write to Future.internalValue directly in macro-translated code #452

Open
arnetheduck opened this issue Oct 16, 2023 · 0 comments
Open

Write to Future.internalValue directly in macro-translated code #452

arnetheduck opened this issue Oct 16, 2023 · 0 comments

Comments

@arnetheduck
Copy link
Member

Although #418 was ultimately not merged, it contains an idea to improve performance in general: instead of allocating a separate var result that gets injected, it instead injects a template result = fut.internalValue which means we use the in-flight future as temporary storage for results instead of a local variable thus saving memory, zero:es and copies.

The technique is interesting but needs to be tested against nim-lang/Nim#22605 of which it may run afoul (along with other correctness / observability issues).

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