Skip to content

Cache continuation used for runtime async callable task thunks#128320

Open
jakobbotsch wants to merge 1 commit into
dotnet:mainfrom
jakobbotsch:cache-task-continuation
Open

Cache continuation used for runtime async callable task thunks#128320
jakobbotsch wants to merge 1 commit into
dotnet:mainfrom
jakobbotsch:cache-task-continuation

Conversation

@jakobbotsch
Copy link
Copy Markdown
Member

@jakobbotsch jakobbotsch commented May 18, 2026

Apply a similar optimization as #127973 to task returning thunks.

This is a very minor throughput optimization, but it also removes the suspension point from all these thunks, which makes each of these thunks smaller.

NAOT sizes
BaseSize DiffSize Delta Percent Improved Name
16,804,352 16,590,336 -214,016 -1.274% System.Linq.AsyncEnumerable.Tests.exe
31,298,048 30,965,760 -332,288 -1.062% System.Net.Http.Functional.Tests.exe
11,991,552 11,928,064 -63,488 -0.529% System.IO.Tests.exe
29,524,992 29,372,928 -152,064 -0.515% System.Net.Http.WinHttpHandler.Functional.Tests.exe
14,900,736 14,832,128 -68,608 -0.460% System.Xml.Linq.Streaming.Tests.exe
20,018,176 19,926,528 -91,648 -0.458% System.Net.WebSockets.Client.Tests.exe
10,667,520 10,618,880 -48,640 -0.456% System.IO.Pipelines.Tests.exe
16,775,680 16,700,928 -74,752 -0.446% System.Xml.Linq.Misc.Tests.exe
20,283,392 20,194,816 -88,576 -0.437% System.Threading.Tasks.Dataflow.Tests.exe
20,950,016 20,861,440 -88,576 -0.423% System.Net.Quic.Functional.Tests.exe
16,523,264 16,453,632 -69,632 -0.421% System.Xml.Linq.Events.Tests.exe
19,069,952 18,990,592 -79,360 -0.416% System.Net.HttpListener.Tests.exe
16,670,720 16,601,600 -69,120 -0.415% System.Xml.Linq.Properties.Tests.exe
22,897,664 22,802,944 -94,720 -0.414% System.Net.Sockets.Tests.exe
17,007,616 16,937,472 -70,144 -0.412% System.Xml.Linq.xNodeReader.Tests.exe
17,063,936 16,993,792 -70,144 -0.411% System.Xml.Linq.xNodeBuilder.Tests.exe
17,122,816 17,053,184 -69,632 -0.407% System.Xml.Linq.TreeManipulation.Tests.exe
10,055,168 10,015,744 -39,424 -0.392% System.IO.Compression.ZipFile.Tests.exe
10,281,984 10,243,072 -38,912 -0.378% System.Threading.Channels.Tests.exe
20,055,552 19,980,800 -74,752 -0.373% System.Formats.Tar.Tests.exe
21,725,696 21,646,336 -79,360 -0.365% System.IO.FileSystem.Tests.exe
19,592,704 19,521,536 -71,168 -0.363% System.IO.Compression.Tests.exe
14,571,520 14,520,320 -51,200 -0.351% System.Net.WebClient.Tests.exe
9,743,872 9,710,080 -33,792 -0.347% System.Threading.RateLimiting.Tests.exe
21,229,568 21,155,840 -73,728 -0.347% System.Net.Requests.Tests.exe
18,470,912 18,412,544 -58,368 -0.316% System.Threading.Tasks.Parallel.Tests.exe
17,734,656 17,679,872 -54,784 -0.309% System.Threading.Tasks.Extensions.Tests.exe
19,575,296 19,515,392 -59,904 -0.306% System.Diagnostics.Process.Tests.exe
28,053,504 27,968,000 -85,504 -0.305% System.Net.Security.Tests.exe
13,245,440 13,207,040 -38,400 -0.290% System.IO.Packaging.Tests.exe
12,423,168 12,388,864 -34,304 -0.276% System.Xml.Linq.SDMSample.Tests.exe
10,064,384 10,036,736 -27,648 -0.275% System.Net.ServerSentEvents.Tests.exe
12,856,320 12,821,504 -34,816 -0.271% System.Xml.Schema.Extensions.Tests.exe
13,874,176 13,836,800 -37,376 -0.269% Microsoft.Extensions.Configuration.Functional.Tests.exe
13,951,488 13,915,136 -36,352 -0.261% Microsoft.Extensions.Configuration.Xml.Tests.exe
33,167,360 33,082,368 -84,992 -0.256% System.Private.Xml.Tests.exe
19,304,448 19,255,296 -49,152 -0.255% System.IO.Pipes.Tests.exe
15,110,656 15,072,256 -38,400 -0.254% System.Drawing.Primitives.Tests.exe
19,900,928 19,850,752 -50,176 -0.252% System.Text.Encoding.Tests.exe
9,258,496 9,235,456 -23,040 -0.249% Microsoft.Bcl.AsyncInterfaces.Tests.exe
18,081,280 18,036,736 -44,544 -0.246% System.Console.Tests.exe
17,449,472 17,406,464 -43,008 -0.246% System.Net.Ping.Functional.Tests.exe
14,139,392 14,104,576 -34,816 -0.246% System.DirectoryServices.Protocols.Tests.exe
19,698,688 19,650,560 -48,128 -0.244% System.Net.Http.Unit.Tests.exe
27,328,512 27,261,952 -66,560 -0.244% Microsoft.Extensions.Hosting.Unit.Tests.exe
15,763,968 15,725,568 -38,400 -0.244% System.Windows.Extensions.Tests.exe
116,337,152 116,055,552 -281,600 -0.242% System.Text.Json.SourceGeneration.Roslyn4.4.Tests.exe
17,590,272 17,548,800 -41,472 -0.236% MetricOuterLoop1.Tests.exe
11,334,656 11,308,032 -26,624 -0.235% System.Net.WebSockets.Tests.exe
15,091,712 15,056,384 -35,328 -0.234% System.Security.Cryptography.Cng.Tests.exe
18,800,128 18,756,096 -44,032 -0.234% Microsoft.Extensions.FileProviders.Physical.Tests.exe
17,584,640 17,543,680 -40,960 -0.233% MetricOuterLoop.Tests.exe
18,940,416 18,896,384 -44,032 -0.232% System.Runtime.Caching.Tests.exe
23,151,104 23,097,344 -53,760 -0.232% System.Threading.Tasks.Tests.exe
17,348,096 17,308,160 -39,936 -0.230% System.Threading.Timer.Tests.exe
18,391,552 18,349,568 -41,984 -0.228% System.Threading.Tests.exe
15,046,144 15,011,840 -34,304 -0.228% System.Data.DataSetExtensions.Tests.exe
17,813,504 17,773,056 -40,448 -0.227% System.Formats.Tar.Manual.Tests.exe
17,233,920 17,195,008 -38,912 -0.226% System.Net.ServicePoint.Tests.exe
17,179,648 17,141,248 -38,400 -0.224% System.Runtime.Serialization.Formatters.Disabled.Tests.exe
10,115,072 10,092,544 -22,528 -0.223% Microsoft.Extensions.Caching.Memory.Tests.exe
17,991,680 17,951,744 -39,936 -0.222% System.Threading.ThreadPool.Tests.exe
18,408,448 18,368,000 -40,448 -0.220% Microsoft.Extensions.Primitives.Tests.exe
17,255,424 17,217,536 -37,888 -0.220% System.Runtime.InvariantTimezone.Tests.exe
17,307,648 17,269,760 -37,888 -0.219% System.Runtime.InteropServices.RuntimeInformation.Tests.exe
17,991,680 17,952,256 -39,424 -0.219% System.Threading.ThreadPool.WindowsThreadPool.Tests.exe
17,317,376 17,279,488 -37,888 -0.219% System.Security.Claims.Tests.exe
17,330,688 17,292,800 -37,888 -0.219% System.Security.Principal.Windows.Tests.exe
18,481,664 18,441,216 -40,448 -0.219% Microsoft.Extensions.Configuration.FileExtensions.Tests.exe
9,343,488 9,323,008 -20,480 -0.219% Microsoft.Extensions.Diagnostics.Abstractions.Tests.exe
17,374,720 17,336,832 -37,888 -0.218% Microsoft.Win32.SystemEvents.Tests.exe
17,635,328 17,596,928 -38,400 -0.218% System.Threading.Thread.Tests.exe
17,449,984 17,412,096 -37,888 -0.217% System.Diagnostics.TraceSource.Tests.exe
9,451,008 9,430,528 -20,480 -0.217% Microsoft.Extensions.Logging.Testing.Tests.exe
17,248,768 17,211,392 -37,376 -0.217% System.ComponentModel.EventBasedAsync.Tests.exe
17,300,480 17,263,104 -37,376 -0.216% System.Threading.Overlapped.Tests.exe
11,594,240 11,569,152 -25,088 -0.216% System.Net.Http.Json.Unit.Tests.exe
17,172,480 17,135,616 -36,864 -0.215% IcuAppLocal.Tests.exe
17,379,840 17,342,464 -37,376 -0.215% System.Diagnostics.StackTrace.Tests.exe
17,679,872 17,641,984 -37,888 -0.214% System.IO.FileSystem.Watcher.Tests.exe
16,115,200 16,080,896 -34,304 -0.213% System.Data.Odbc.Tests.exe
18,533,888 18,494,464 -39,424 -0.213% System.IO.MemoryMappedFiles.Tests.exe
18,147,328 18,108,928 -38,400 -0.212% System.Diagnostics.TextWriterTraceListener.Tests.exe
18,383,872 18,344,960 -38,912 -0.212% Microsoft.Extensions.FileProviders.Composite.Tests.exe
18,195,968 18,157,568 -38,400 -0.211% System.Text.Encoding.CodePages.Tests.exe
17,681,408 17,644,032 -37,376 -0.211% System.Buffers.Tests.exe
20,877,824 20,833,792 -44,032 -0.211% System.Security.Cryptography.Csp.Tests.exe
18,518,528 18,479,616 -38,912 -0.210% Microsoft.Extensions.Configuration.Tests.exe
18,051,072 18,013,696 -37,376 -0.207% Microsoft.Extensions.Diagnostics.Tests.exe
9,669,120 9,649,152 -19,968 -0.207% Microsoft.Extensions.Hosting.Functional.Tests.exe
18,507,776 18,469,888 -37,888 -0.205% Microsoft.Extensions.Hosting.Systemd.Tests.exe
19,098,624 19,059,712 -38,912 -0.204% Microsoft.Extensions.Hosting.WindowsServices.Tests.exe
18,696,704 18,658,816 -37,888 -0.203% Microsoft.Extensions.Logging.Console.Tests.exe
24,305,152 24,256,000 -49,152 -0.202% Microsoft.Extensions.Http.Tests.exe
18,605,056 18,567,680 -37,376 -0.201% ComInterfaceGenerator.Tests.exe
19,421,696 19,383,296 -38,400 -0.198% System.Net.Primitives.Functional.Tests.exe
19,998,720 19,959,808 -38,912 -0.195% Microsoft.Extensions.Logging.Tests.exe
20,253,184 20,214,784 -38,400 -0.190% System.Runtime.InteropServices.Tests.exe
10,518,528 10,498,560 -19,968 -0.190% Microsoft.Extensions.Options.Tests.exe
19,763,200 19,726,336 -36,864 -0.187% System.Resources.ResourceManager.Tests.exe
21,624,320 21,583,872 -40,448 -0.187% System.Data.OleDb.Tests.exe
20,756,480 20,718,080 -38,400 -0.185% System.Collections.Concurrent.Tests.exe
20,600,832 20,562,944 -37,888 -0.184% System.Diagnostics.DiagnosticSource.Tests.exe
20,475,392 20,438,016 -37,376 -0.183% System.Reflection.Tests.exe
20,951,552 20,914,176 -37,376 -0.178% System.Runtime.Extensions.Tests.exe
20,114,944 20,080,128 -34,816 -0.173% Microsoft.Extensions.Configuration.Json.Tests.exe
11,277,824 11,258,368 -19,456 -0.173% System.IO.Compression.Brotli.Tests.exe
20,054,016 20,019,712 -34,304 -0.171% Microsoft.Extensions.Configuration.UserSecrets.Tests.exe
26,464,768 26,421,248 -43,520 -0.164% System.ComponentModel.TypeConverter.Tests.exe
23,422,464 23,384,576 -37,888 -0.162% System.Memory.Tests.exe
30,139,904 30,095,360 -44,544 -0.148% Microsoft.Extensions.DependencyModel.Tests.exe
26,022,400 25,985,024 -37,376 -0.144% System.Globalization.Nls.Tests.exe
26,110,976 26,074,112 -36,864 -0.141% System.Globalization.Tests.exe
26,665,984 26,628,608 -37,376 -0.140% Microsoft.Extensions.Logging.EventSource.Tests.exe
45,565,952 45,507,072 -58,880 -0.129% System.Security.Cryptography.Tests.exe
32,766,464 32,729,088 -37,376 -0.114% System.Linq.Expressions.Tests.exe
33,411,072 33,373,696 -37,376 -0.112% Microsoft.Bcl.Cryptography.Tests.exe
44,862,976 44,815,360 -47,616 -0.106% System.Runtime.Tests.exe
25,902,080 25,875,968 -26,112 -0.101% System.Text.Json.SourceGeneration.Roslyn3.11.Tests.exe
9,584,128 9,578,496 -5,632 -0.059% System.Memory.Data.Tests.exe
10,504,192 10,498,048 -6,144 -0.058% System.Net.Http.WinHttpHandler.Unit.Tests.exe
12,290,048 12,283,392 -6,656 -0.054% System.Net.NetworkInformation.Functional.Tests.exe
16,982,016 16,973,824 -8,192 -0.048% System.Private.CoreLib.dll
9,372,160 9,368,064 -4,096 -0.044% System.Net.Mail.Unit.Tests.exe
4,897,792 4,899,840 +2,048 +0.042% coreclr.dll
10,593,792 10,590,208 -3,584 -0.034% Common.Tests.exe
9,038,336 9,035,776 -2,560 -0.028% System.Net.NameResolution.Pal.Tests.exe
9,347,072 9,344,512 -2,560 -0.027% System.IO.IsolatedStorage.Tests.exe
9,537,024 9,534,464 -2,560 -0.027% System.IO.Hashing.Tests.exe
9,669,632 9,667,072 -2,560 -0.026% System.IO.UnmanagedMemoryStream.Tests.exe
8,541,696 8,539,648 -2,048 -0.024% System.IO.FileSystem.Primitives.Tests.exe
8,560,640 8,558,592 -2,048 -0.024% System.Diagnostics.Contracts.Tests.exe
8,622,080 8,620,032 -2,048 -0.024% System.Xml.Linq.Axes.Tests.exe
8,557,056 8,555,008 -2,048 -0.024% System.Composition.AttributeModel.Tests.exe
8,599,552 8,597,504 -2,048 -0.024% Microsoft.Extensions.Hosting.Abstractions.Tests.exe
8,590,848 8,588,800 -2,048 -0.024% Microsoft.Bcl.Numerics.Tests.exe
8,686,080 8,684,032 -2,048 -0.024% System.Runtime.InteropServices.ComDisabled.Tests.exe
8,603,648 8,601,600 -2,048 -0.024% System.Resources.Writer.Tests.exe
8,698,368 8,696,320 -2,048 -0.024% System.IO.FileSystem.Manual.Tests.exe
10,934,272 10,931,712 -2,560 -0.023% System.Runtime.Intrinsics.Tests.exe
9,081,344 9,079,296 -2,048 -0.023% System.ValueTuple.Tests.exe
8,862,720 8,860,672 -2,048 -0.023% System.Reflection.Extensions.Tests.exe
8,987,136 8,985,088 -2,048 -0.023% System.Net.Primitives.Pal.Tests.exe
8,834,560 8,832,512 -2,048 -0.023% System.Console.Manual.Tests.exe
9,001,984 8,999,936 -2,048 -0.023% System.Runtime.Serialization.Primitives.Tests.exe
8,815,616 8,813,568 -2,048 -0.023% System.Web.HttpUtility.Tests.exe
8,715,776 8,713,728 -2,048 -0.023% System.Diagnostics.FileVersionInfo.Tests.exe
8,989,696 8,987,648 -2,048 -0.023% Microsoft.Win32.Registry.Tests.exe
8,928,256 8,926,208 -2,048 -0.023% System.IO.Pipes.AccessControl.Tests.exe
8,767,488 8,765,440 -2,048 -0.023% System.IO.FileSystem.DriveInfo.Tests.exe
9,163,776 9,161,728 -2,048 -0.022% System.Globalization.Calendars.Tests.exe
9,107,456 9,105,408 -2,048 -0.022% System.IO.FileSystem.AccessControl.Tests.exe
11,794,944 11,792,384 -2,560 -0.022% System.Security.Cryptography.Cose.Tests.exe
9,362,432 9,360,384 -2,048 -0.022% System.Reflection.Context.Tests.exe
9,204,224 9,202,176 -2,048 -0.022% Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.exe
9,213,952 9,211,904 -2,048 -0.022% System.ServiceProcess.ServiceController.Tests.exe
9,801,728 9,799,680 -2,048 -0.021% System.Net.WebProxy.Tests.exe
9,702,400 9,700,352 -2,048 -0.021% System.Text.RegularExpressions.Unit.Tests.exe
9,761,792 9,759,744 -2,048 -0.021% System.Formats.Asn1.Tests.exe
9,959,936 9,957,888 -2,048 -0.021% LibraryImportGenerator.Tests.exe
9,947,648 9,945,600 -2,048 -0.021% System.Collections.NonGeneric.Tests.exe
9,628,160 9,626,112 -2,048 -0.021% System.Composition.Convention.Tests.exe
11,046,912 11,044,864 -2,048 -0.019% System.Runtime.Numerics.Tests.exe
8,698,880 8,697,344 -1,536 -0.018% System.Security.Cryptography.ProtectedData.Tests.exe
8,717,312 8,715,776 -1,536 -0.018% System.Private.Uri.Unit.Tests.exe
8,645,632 8,644,096 -1,536 -0.018% Microsoft.Win32.Registry.AccessControl.Tests.exe
8,678,912 8,677,376 -1,536 -0.018% System.Runtime.CompilerServices.Unsafe.Tests.exe
8,544,256 8,542,720 -1,536 -0.018% System.Runtime.CompilerServices.VisualC.Tests.exe
8,668,160 8,666,624 -1,536 -0.018% System.Runtime.Handles.Tests.exe
8,638,976 8,637,440 -1,536 -0.018% System.Net.WebHeaderCollection.Tests.exe
8,775,680 8,774,144 -1,536 -0.018% Microsoft.Bcl.TimeProvider.Tests.exe
8,546,304 8,544,768 -1,536 -0.018% System.Diagnostics.Tools.Tests.exe
11,378,688 11,376,640 -2,048 -0.018% System.Net.Security.Unit.Tests.exe
8,556,032 8,554,496 -1,536 -0.018% System.Text.Encoding.Extensions.Tests.exe
8,702,464 8,700,928 -1,536 -0.018% System.Security.SecureString.Tests.exe
8,756,736 8,755,200 -1,536 -0.018% Invariant.Tests.exe
8,622,592 8,621,056 -1,536 -0.018% System.Composition.Runtime.Tests.exe
9,037,312 9,035,776 -1,536 -0.017% Microsoft.Extensions.FileSystemGlobbing.Tests.exe
8,957,952 8,956,416 -1,536 -0.017% System.Threading.AccessControl.Tests.exe
9,141,760 9,140,224 -1,536 -0.017% System.Security.AccessControl.Tests.exe
9,053,696 9,052,160 -1,536 -0.017% Microsoft.Extensions.Configuration.CommandLine.Tests.exe
9,023,488 9,021,952 -1,536 -0.017% System.Reflection.TypeExtensions.Tests.exe
12,282,368 12,280,320 -2,048 -0.017% System.Reflection.Metadata.Tests.exe
8,950,784 8,949,248 -1,536 -0.017% Microsoft.Bcl.Memory.Tests.exe
9,747,968 9,746,432 -1,536 -0.016% System.Collections.Specialized.Tests.exe
9,644,032 9,642,496 -1,536 -0.016% System.Private.Uri.Functional.Tests.exe
9,850,880 9,849,344 -1,536 -0.016% System.Formats.Nrbf.Tests.exe
9,311,744 9,310,208 -1,536 -0.016% System.Net.Primitives.UnitTests.Tests.exe
10,052,608 10,051,072 -1,536 -0.015% System.Diagnostics.Debug.Tests.exe
17,838,592 17,836,032 -2,560 -0.014% System.Collections.Tests.exe
15,544,320 15,542,272 -2,048 -0.013% System.Linq.Tests.exe
8,650,752 8,649,728 -1,024 -0.012% System.Globalization.CalendarsWithConfigSwitch.Tests.exe
8,662,016 8,660,992 -1,024 -0.012% Microsoft.Win32.Primitives.Tests.exe
8,545,280 8,544,256 -1,024 -0.012% System.ComponentModel.Tests.exe
9,159,168 9,158,144 -1,024 -0.011% System.ComponentModel.Primitives.Tests.exe
9,624,576 9,623,552 -1,024 -0.011% System.Diagnostics.EventLog.Tests.exe
9,484,288 9,483,264 -1,024 -0.011% Microsoft.Extensions.Configuration.Ini.Tests.exe
9,358,848 9,357,824 -1,024 -0.011% System.Security.Permissions.Tests.exe
11,480,576 11,479,552 -1,024 -0.009% System.IO.Ports.Tests.exe
11,191,296 11,190,272 -1,024 -0.009% System.Text.Encodings.Web.Tests.exe
11,607,040 11,606,016 -1,024 -0.009% System.Resources.Extensions.Tests.exe
13,555,200 13,556,224 +1,024 +0.008% crossgen2.exe
22,337,536 22,336,000 -1,536 -0.007% System.Security.Cryptography.Pkcs.Tests.exe
15,397,376 15,396,352 -1,024 -0.007% System.Globalization.Extensions.Tests.exe
15,397,376 15,396,352 -1,024 -0.007% System.Globalization.Extensions.Nls.Tests.exe
8,808,960 8,808,448 -512 -0.006% System.Resources.Reader.Tests.exe
16,053,760 16,054,784 +1,024 +0.006% ilc.exe
18,775,040 18,774,528 -512 -0.003% System.Numerics.Vectors.Tests.exe
2,247,784 2,247,784 0 0.000% Microsoft.DiaSymReader.Native.arm64.dll
1,754,512 1,754,512 0 0.000% Microsoft.DiaSymReader.Native.arm.dll
2,309,152 2,309,152 0 0.000% Microsoft.DiaSymReader.Native.amd64.dll
2,247,784 2,247,784 0 0.000% Microsoft.DiaSymReader.Native.arm64.dll
108,032 108,032 0 0.000% CMakeCCompilerId.exe
1,377,280 1,377,280 0 0.000% System.IO.Compression.Native.dll
108,032 108,032 0 0.000% CMakeCXXCompilerId.exe
2,309,152 2,309,152 0 0.000% Microsoft.DiaSymReader.Native.amd64.dll
1,935,296 1,935,296 0 0.000% Microsoft.DiaSymReader.Native.x86.dll
84,480 84,480 0 0.000% System.Globalization.Native.dll
696,320 696,320 0 0.000% FileCheck.exe
1,935,296 1,935,296 0 0.000% Microsoft.DiaSymReader.Native.x86.dll
1,754,512 1,754,512 0 0.000% Microsoft.DiaSymReader.Native.arm.dll
536,096 536,096 0 0.000% msquic.dll
1,935,296 1,935,296 0 0.000% Microsoft.DiaSymReader.Native.x86.dll
307,200 307,200 0 0.000% clretwrc.dll
1,935,296 1,935,296 0 0.000% Microsoft.DiaSymReader.Native.x86.dll
2,309,152 2,309,152 0 0.000% Microsoft.DiaSymReader.Native.amd64.dll
2,247,784 2,247,784 0 0.000% Microsoft.DiaSymReader.Native.arm64.dll
1,754,512 1,754,512 0 0.000% Microsoft.DiaSymReader.Native.arm.dll
1,935,296 1,935,296 0 0.000% Microsoft.DiaSymReader.Native.x86.dll
678,400 678,400 0 0.000% clrgc.dll
2,247,784 2,247,784 0 0.000% Microsoft.DiaSymReader.Native.arm64.dll
2,309,152 2,309,152 0 0.000% Microsoft.DiaSymReader.Native.amd64.dll
7,809,536 7,809,536 0 0.000% ilasm.exe
9,956,864 9,956,864 0 0.000% llvm-mca.exe
696,320 696,320 0 0.000% FileCheck.exe
1,377,280 1,377,280 0 0.000% System.IO.Compression.Native.dll
84,480 84,480 0 0.000% System.Globalization.Native.dll
1,754,512 1,754,512 0 0.000% Microsoft.DiaSymReader.Native.arm.dll
722,944 722,944 0 0.000% clrgcexp.dll
2,215,936 2,215,936 0 0.000% clrjit.dll
210,944 210,944 0 0.000% corerun.exe
2,309,152 2,309,152 0 0.000% Microsoft.DiaSymReader.Native.amd64.dll
2,247,784 2,247,784 0 0.000% Microsoft.DiaSymReader.Native.arm64.dll
1,754,512 1,754,512 0 0.000% Microsoft.DiaSymReader.Native.arm.dll
1,935,296 1,935,296 0 0.000% Microsoft.DiaSymReader.Native.x86.dll
2,247,784 2,247,784 0 0.000% Microsoft.DiaSymReader.Native.arm64.dll
1,754,512 1,754,512 0 0.000% Microsoft.DiaSymReader.Native.arm.dll
2,309,152 2,309,152 0 0.000% Microsoft.DiaSymReader.Native.amd64.dll
1,377,280 1,377,280 0 0.000% System.IO.Compression.Native.dll
536,096 536,096 0 0.000% msquic.dll
1,284,608 1,284,608 0 0.000% mscordbi.dll
1,465,856 1,465,856 0 0.000% mscordaccore.dll
1,465,856 1,465,856 0 0.000% mscordaccore_amd64_amd64_42.42.42.42424.dll
361,984 361,984 0 0.000% hostpolicy.dll
350,208 350,208 0 0.000% hostfxr.dll
62,464 62,464 0 0.000% createdump.exe
9,956,864 9,956,864 0 0.000% llvm-mca.exe
7,457,280 7,457,280 0 0.000% XUnitLogChecker.exe

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Applies the cached-continuation optimization from PR #127973 to Task-returning runtime async callable thunks. Instead of allocating per suspension, the thunks now reuse a thread-cached TaskContinuation instance, mirroring the ValueTaskContinuation design. The thunk IL is also restructured to emit an explicit TailAwait() followed by a generic TransparentAwait<T> (or non-generic), eliminating the suspension point inside each thunk.

Changes:

  • New TaskContinuation type (cached in RuntimeAsyncAwaitState.CachedTaskContinuation) replaces the raw TaskNotifier field; TransparentAwait and the new TransparentAwaitOfT<T> allocate-only-on-miss.
  • Thunk IL emit (both CoreCLR JIT-time and AOT-time stub generators) now selects TransparentAwait vs. instantiated TransparentAwaitOfT<T> and prepends a TailAwait call, removing the suspension point from the thunk itself.
  • HandleSuspended updated to drive completion via taskCont.Task.TryAddCompletionAction instead of the old TaskNotifier path.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.TaskContinuation.cs New TaskContinuation continuation class, mirroring ValueTaskContinuation (Initialize/GetResult/Resume).
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs Replaces TaskNotifier with TaskContinuation; adds generic TransparentAwaitOfT<T>; updates HandleSuspended.
src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj Adds new TaskContinuation source file to CoreCLR CoreLib build.
src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj Adds new TaskContinuation source file to NativeAOT CoreLib build.
src/coreclr/vm/corelib.h Defines TRANSPARENT_AWAIT_OF_T method binding for the new generic helper.
src/coreclr/vm/asyncthunks.cpp Emits TailAwait + TransparentAwait/TransparentAwaitOfT<T> in the task-returning thunk IL.
src/coreclr/tools/Common/TypeSystem/IL/Stubs/AsyncThunks.cs AOT stub generator mirrors the same emit changes for task thunks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants