YamlDotNet icon indicating copy to clipboard operation
YamlDotNet copied to clipboard

Optimize YamlScalarNode.Load and YamlMappingNode.Load

Open lahma opened this issue 1 year ago • 0 comments

Improving scalar loading performance a bit as it's done a lot for common files. Check for "null" marker faster and don't do try-catch in a loop. I fixed the saltern example YAML file for easier testing.

The OrderedDictionary change looks large, but it seems that it has been stored in Git with wrong newlines and always pops up as modified otherwise. If you check ignore whitespace in PR view that should help.

YamlDotNet.Benchmark.YamlStreamBenchmark

Diff Method Toolchain Mean Error
Old LoadLarge Default 61.27 ms 0.538 ms
New Default 55.86 ms (-9%) 0.891 ms

lahma avatar Jun 02 '24 09:06 lahma