Uh oh!
There was an error while loading. Please reload this page.
Use more spans in System.Reflection.Metadata et. al. - #76574
Conversation
ghost
commented
Oct 3, 2022
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata Issue DetailsThis PR among other things changes the buffer code of
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Nit: You could tidy this (and the others like it) up to just be:
publicstaticvoidWriteUInt16(thisbyte[]buffer,intstart,ushortvalue)=>Unsafe.WriteUnaligned(refbuffer[start],BitConverter.IsLittleEndian?BinaryPrimitives.ReverseEndianness(value):value);Uh oh!
There was an error while loading. Please reload this page.
steveharter
commented
Oct 26, 2022
Are there any remaining CI issues? There were some Mono build failures, but I suspect infrastructure and just re-ran those. |
steveharter
commented
Oct 27, 2022
@teo-tsirpanis can you rebase to the latest? There are these build errors that have already recently been fixed (see this PR): |
Code quality increases.
It prevents the JIT from looking into the method's body, realizing it's a throw helper, and doing what's best (such as considering it cold).
teo-tsirpanis
commented
Oct 27, 2022
Done @steveharter. |
This PR among other things changes the buffer code of
System.Reflection.Metadataso that it uses spans and framework methods that are more optimized, and reduces pinning and unsafely converting between immutable and mutable arrays.