Closed VSadov closed 9 months ago
@jakobbotsch - I expect the state-machine flavor to behave similar to async-1 on this test, but could not measure due to unexpected exceptions.
Possible some issue with keeping continuations alive?
async-2 =====================
..........Time per Gen0 GC (microseconds): 377
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not set to an instance of an object.) (Object reference not . . . .
I'll take a look @VSadov. In the mean time, it looks like it works with opened a PR with the fix.DOTNET_TieredCompilation=0
, so you can try that to get the measurements
I have added GC pause/allocation observations to the write-up as a part of this PR:
https://github.com/dotnet/runtimelab/pull/2425/files#r1412337061
Thanks!
Added a test that measures durations of trivial gen-0 GCs in the presence of 10000 suspended tasks, with 100 frames each. Both async-1 and async-2 are measured.
Introduced tasklet aging to avoid reporting old stacks in younger GCs. Since a suspended stack cannot suddenly start pointing to younger objects, we can avoid reporting some suspended stacks when they cannot possibly have anything young enough to be of interest to the current GC cycle. Tasklet aging considerably reduces GC pauses due to root reporting.
Added a switch to turn aging on/off -
DOTNET_TaskletAging
. The default state ison
Changed the shape of tasklet storage. Instead of one big list, it is a list of lists. The inner lists belong to the same stack. This is to enable aging of an entire stack. Also to reduce locking when tasklets are resumed (only resuming/unlinking the head needs a lock)