Struct Serialization with Spans
12/28/2018
In one of the books, Pro .Net Performance, an some examples are mentioned for struct serialization on the chapter of 'Code Generation'.
Since the book was released the C# has evolved, and some of the constraints has been removed earlier existed. Also with C# 7.2 and above we have Span at the hands of the developers so performance improvements can be implemented.
In this post, I will take the 2 deserialization examples of the book and compare it with the latest constructs available with Span and unmanaged generics.