Closed maxvoxel8 closed 3 years ago
Also don't allocate the extra StringBuilders in ScanPlainScalar
unless needed.
The left profile is before my changes, the middle profile is with 6f5e365, the right is with 5a168a5.
Speed up adding nodes when tracker is used. This is a performance penalty that only exists if tracker is assigned.
Improve write performance by reducing allocation in AnalyzeScalar (ideally the StringLookaheadBuffer should also not be allocated, but that requires more changes).
Speed up YamlNode.DeepClone by not copying immutable ParserEvent values and by pre-allocating list size. Not sure why I was copying the events to begin with...
@xoofx thanks for the merge, I do have another performance change I'm working on that I will make another PR for.
Performance improvement to use StringLookaheadBuffer where a string can be directly accessed. This proves important especially with YAML that has a lot of quoted values that makes heavy use of ScanFlowScalar.
This is a before and after comparison in DotTrace using Sample mode:
This is using Tracing mode: