future: another sink attempt#639
Merged
arnetheduck merged 3 commits intomasterfrom Apr 8, 2026
Merged
Conversation
Allowing `complete` to `sink` values avoids the compiler to move values into the future which can avoid copies in a few cases: Previous attempts have been reverted due to nim-lang/Nim#23354. Incidentally, we can also remove the workaround for [literals](nim-lang/Nim#22175) since we gate the usage of sink from 2.0.6.
4e4994a to
e7fb4db
Compare
cheatfate
approved these changes
Apr 7, 2026
arnetheduck
added a commit
that referenced
this pull request
Apr 8, 2026
While waiting for: * #601 * #578 * nim-lang/Nim#25057 In particular, the move-on-return are ugly but needed for #639 to do its job well
Merged
arnetheduck
added a commit
that referenced
this pull request
Apr 9, 2026
While waiting for: * #601 * #578 * nim-lang/Nim#25057 In particular, the move-on-return are ugly but needed for #639 to do its job well
arnetheduck
added a commit
that referenced
this pull request
Apr 9, 2026
While waiting for: * #601 * #578 * nim-lang/Nim#25057 In particular, the move-on-return are ugly but needed for #639 to do its job well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous attempts have been reverted due to
nim-lang/Nim#23354.
Incidentally, we can also remove the workaround for literals since we gate the usage of sink from 2.0.6.
We also have to be mindful of nim-lang/Nim#12340 which does not affect this particular usage of sink but is adjacent enough that it could cause trouble in the future, if we also move the value out of the future.
Pre (2.2.4, refc):
Post (2.2.4, refc):
Notably, orc is very slow - using devel which already has some improvements: