0

According to comment by Ondrej Svejdar in this question, only startup performance will be affected, not overall perf.

The winning answer here claims the opposite, stating that the serialization assembly is generated on every execution. I take that to mean that every time that portion of the code is hit, a serialization assembly is generated.

Which is correct?

AngryHacker
  • 59,598
  • 102
  • 325
  • 594

1 Answers1

2

It will only affect startup performance for an application.

https://learn.microsoft.com/en-us/dotnet/standard/serialization/xml-serializer-generator-tool-sgen-exe

When the XML Serializer Generator is not used, a XmlSerializer generates serialization code and a serialization assembly for each type every time an application is run. To improve the performance of XML serialization startup, use the Sgen.exe tool to generate those assemblies in advance. These assemblies can then be deployed with the application.

The XML Serializer Generator can also improve the performance of clients that use XML Web service proxies to communicate with servers because the serialization process will not incur a performance hit when the type is loaded the first time.

Community
  • 1
  • 1
Jerry
  • 1,477
  • 7
  • 14