Shrink Task.Delay when used without Cancellation#22233
Conversation
|
@dotnet test OSX10.12 x64 Checked Innerloop Build and Test |
|
That 7 bytes of padding bothers me. Is there a way to mask the voidresult into the state flags? |
No. That's just the generic TResult. The right answer there is to move the promise functionality down from the generic task into the non-generic one. It's on my to-do list to explore that. |
Could move Though it would go back to 4 bytes after making it non-generic (e.g. moving |
|
I just hadn't realised it was |
8174eef to
28584ce
Compare
|
28584ce to
7e9a8cb
Compare
|
Fixed commits; change should be the same |
|
Though I think I have them reversed O_o |
|
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test |
|
@benaadams Could you please resolve the conflict? |
7e9a8cb to
3db18f1
Compare
|
Resolved. |
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Task.Delayis commonly used without cancellation:Task Delay(int)- API Port 22.6%Task Delay(TimeSpan)- API Port 9.8%Task Delay(int, CancellationToken)- API Port 5.6%Task Delay(TimeSpan, CancellationToken)- API Port 9.3%This shaves 24 bytes of allocation off that common path.
Using @SergeyTeplyakov's ObjectLayoutInspector and local copies of the internal objects to make it easier to inspect.
To
/cc @stephentoub