zzzprojects / html-agility-pack

Html Agility Pack (HAP) is a free and open-source HTML parser written in C# to read/write DOM and supports plain XPATH or XSLT. It is a .NET code library that allows you to parse "out of the web" HTML files.
https://html-agility-pack.net
MIT License
2.63k stars 375 forks source link

Optimize HtmlNode.WriteAttribute #556

Open lahma opened 3 months ago

lahma commented 3 months ago

When checking for docfx performance, I noticed that a lot of string allocations were done inside of HtmlAgilityPack. This PR changes WriteAttribute to call separate Write calls instead of concatenating strings before writing them.

image