xoofx / SharpYaml

SharpYaml is a .NET library for YAML compatible with CoreCLR
Other
334 stars 61 forks source link

Make CoreSchema a singleton so that PrepareScalarRules only runs once. #75

Closed maxvoxel8 closed 4 years ago

maxvoxel8 commented 4 years ago

I ran into a performance problem because I was deserializing individual leaf nodes of a YAML file using YamlNode.ToObject, and so I was creating a new SerializerSettings every time. As a result, PrepareScalarRules in CoreSchema ran over and over and was a big performance hit. This solves that problem.