dotnet / dotnet/api-docs-sync

Bottleneck reading XML element value

Offen
#80 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
port-to-docs
Vorherrschende Sprache
C#
Sterne
14
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Up to 40-50% of the time can be spent in this method
https://github.com/carlossanlop/DocsPortingTool/blob/main/Libraries/XmlHelper.cs#L134-L143

It is simply reading the value of an element, but it needs to do it literally, ie., any CDATA wrapping it, etc, so it can't just get Value. This forces creating an Xml text writer, etc - it's very slow.

I added in a comment there an alternative way of doing this based on the stackoverflow post below

https://stackoverflow.com/questions/3793/best-way-to-get-innerxml-of-an-xelement

I didn't try every scenario but it seems to produce the same result albeit with sometimes different line wraps (possibly an improvement). It's about twice as fast so if it's good enough it could be swapped for what is there now.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.