Skip to content

future: another sink attempt#639

Merged
arnetheduck merged 3 commits intomasterfrom
sink-fut-again
Apr 8, 2026
Merged

future: another sink attempt#639
arnetheduck merged 3 commits intomasterfrom
sink-fut-again

Conversation

@arnetheduck
Copy link
Copy Markdown
Member

@arnetheduck arnetheduck commented Apr 7, 2026

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):

| Small/small    |    0.059s |   1000 | 17070.173 |    0.031 MB |    0.016 MB |    0.521 MB/s |    0.277 MB/s |
| Medium/small   |    0.887s |   1000 | 1127.296 | 1000.000 MB |    0.021 MB | 1127.296 MB/s |    0.024 MB/s |
| Small/Medium   |    1.218s |   1000 |  820.972 |    0.031 MB | 1000.000 MB |    0.025 MB/s |  820.972 MB/s |
| Medium/Medium  |    1.679s |   1000 |  595.596 | 1000.000 MB | 1000.000 MB |  595.596 MB/s |  595.596 MB/s |

Post (2.2.4, refc):

| Small/small    |    0.063s |   1000 | 15865.303 |    0.031 MB |    0.016 MB |    0.484 MB/s |    0.257 MB/s |
| Medium/small   |    0.784s |   1000 | 1275.976 | 1000.000 MB |    0.021 MB | 1275.976 MB/s |    0.027 MB/s |
| Small/Medium   |    1.024s |   1000 |  976.662 |    0.031 MB | 1000.000 MB |    0.030 MB/s |  976.662 MB/s |
| Medium/Medium  |    1.435s |   1000 |  696.936 | 1000.000 MB | 1000.000 MB |  696.936 MB/s |  696.936 MB/s |

Notably, orc is very slow - using devel which already has some improvements:

| Small/small    |    0.050s |   1000 | 19820.812 |    0.031 MB |    0.016 MB |    0.605 MB/s |    0.321 MB/s |
| Medium/small   |    1.504s |   1000 |  665.016 | 1000.000 MB |    0.021 MB |  665.016 MB/s |    0.014 MB/s |
| Small/Medium   |    1.827s |   1000 |  547.325 |    0.031 MB | 1000.000 MB |    0.017 MB/s |  547.325 MB/s |
| Medium/Medium  |    2.145s |   1000 |  466.266 | 1000.000 MB | 1000.000 MB |  466.266 MB/s |  466.266 MB/s |

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.
@arnetheduck arnetheduck merged commit 9dc6066 into master Apr 8, 2026
26 checks passed
@arnetheduck arnetheduck deleted the sink-fut-again branch April 8, 2026 06:19
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
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
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

Successfully merging this pull request may close these issues.

2 participants