41431 improve performance and usage of xml serializer namespaces (#56438)
authorSteve Molloy <smolloy@microsoft.com>
Thu, 12 Aug 2021 21:24:44 +0000 (14:24 -0700)
committerGitHub <noreply@github.com>
Thu, 12 Aug 2021 21:24:44 +0000 (14:24 -0700)
commit393819de3365eab0bc195c67f97f3912a31f3d85
tree99265f6ecee71a5b3700a71a116d8ce131ae5547
parentad624e42bb83ebf21980f98101710d9086b1ad4b
41431 improve performance and usage of xml serializer namespaces (#56438)

* Allow easier creation of correctly sized dictionaries in scenarios with lots of known namespaces.

* Stop passing internal dictionaries around.

* Reduce enumerations, and immutable-ish improvements.

* PR feedback.

* Use ValueCollection directly instead of IEnumerable<> to avoid virtual calls.

* Update XmlSerializerNamespaces.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaNamespacemanager.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchema.cs
src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdBuilder.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/Types.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs
src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializerNamespaces.cs