Bottleneck reading XML element value
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- performance, tooling
Research direction
Start in Libraries/XmlHelper.cs at lines 134-143 and compare the current XML text-writer implementation with the alternative described in the issue and linked Stack Overflow post. Check representative XML cases, including CDATA, and benchmark the approaches; done means the faster implementation preserves the required element text output.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 14
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/api-docs-sync
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
dotnet/api-docs-sync#182 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dotnet/api-docs-sync#181 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dotnet/api-docs-sync#180 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dotnet/api-docs-sync#179 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
dotnet/api-docs-sync#178 · 1 comment ·
All issues in dotnet/api-docs-sync
Similar issues
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100