From #129157 (comment)
usingSystem;usingSystem.Runtime.CompilerServices;[module:SkipLocalsInit]publicclassProg{staticvoidTest(stringstr){if(TryParse(str,outvarms))Console.WriteLine(ms.A);}structMyStruct{publicstringX;// replace with longpubliclongA;publiclongB;publiclongC;publiclongD;publiclongE;publiclongF;publiclongG;publiclongH;}[MethodImpl(MethodImplOptions.NoInlining)]staticboolTryParse(stringstr,outMyStructms)=>thrownull;}Normally, under SkipLocalsInit, the JIT can omit zeroing for out parameters and it does that if it has no GC fields, once at least one GC field is there it clears the entire struct while it could only clear individual GC slots (e.g. when there are just a few of them in a large struct)
Godbolt link: https://godbolt.org/z/xMTcqn8EW
From #129157 (comment)
Normally, under SkipLocalsInit, the JIT can omit zeroing for out parameters and it does that if it has no GC fields, once at least one GC field is there it clears the entire struct while it could only clear individual GC slots (e.g. when there are just a few of them in a large struct)
Godbolt link: https://godbolt.org/z/xMTcqn8EW