Feat: Maximize performance for XML/HTML parsing
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- html, typescript, wasm, xml
- Domain
- performance, tooling
Research direction
Read the discussion on #1162 and inspect the parser call sites that create parsers, select event bitmasks, and call toJSON(); the issue does not name files or tests. Compare current XML parsing behavior and throughput before and after parser pooling and the event and serialization audits. Done means parser reuse is bounded, unnecessary events and toJSON() calls are removed where safe, and performance improves without changing parsing behavior.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Current sax-wasm implementations could be improved to maximize throughput, reduce time spent inside initialization sequences and tighten latencies.
Describe the solution you'd like
Strong candidates for quick wins
1. Introduce parser pooling
There's currently 1 parser per file which requires constructing a new parser and preparing the WASM several times with each run. Once the file is processed, the parser is thrown away even though it is designed to be re-used. A pool of parsers could be introduced so concurrency can be upheld and parsers re-used. Limiting parsers to a finite number would also prevent runaway memory growth on very high file counts - something that is a risk today.
2. Audit parser usage to trim unneeded events from the bitmask
Events such as OpenTag already contain the fully hydrated attributes making the Attributes event unneeded. Default event bitmasks could also contain more than is necessary. An audit could yield a minimal event bitmask for each usage which is more idiomatic and maps to better performance overall.
3. Audit toJSON() on data yielded from the parser
Calling toJSON() is expensive and only necessary when data from the parser crosses an async boundary. A quick scan of source code has not shown this behavior exists - omitting the toJSON() calls appears safe.
Describe alternatives you've considered
Leave this as-is and backlog for another day.
Additional context
This is a follow on to #1162 (see discussion). This affects XML parsing paths but is expected to have a modest effect on E2E. Nevertheless, this optimization is foundational if migrations to TS v7.2+ or OXC for AST traversal occur.
- Dominant language
- TypeScript
- Stars
- 82
- Forks
- 14
- Avg merge
- 10h 17m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 UI5/linter
-
Sync UI5 versions across projectMay be free again @flovogt claimed this 53 days ago, and no pull request is open. Opendetection
UI5/linter#1155 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Manifest best practices: Detect `serviceUrl` or `uri` under `/sap.ui5/models` and migrate to `/sap.app/dataSources`May be free again @flovogt claimed this 61 days ago, and no pull request is open. Opendetection
UI5/linter#1145 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Detect and possibly autofix missing super calls when overriding UI5 lifecycle and event hooksMay be free again @flovogt claimed this 67 days ago, and no pull request is open. Opendetection
Difficulty 4/5 3-5 days Newbie friendliness 45/100
UI5/linter#1140 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Detect and fix missing library dependencies in UI5 YAMLMay be free again @flovogt claimed this 68 days ago, and no pull request is open. Openautofix detection
UI5/linter#1139 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Detect and fix direct imports of sap/m/URLHelperMay be free again @flovogt claimed this 68 days ago, and no pull request is open. Openautofix detection
UI5/linter#1138 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
platform:windows provider:antigravity-cli providers setup triaged wontfix
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
can1357/oh-my-pi#21349 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ohcnetwork/care_fe#17474 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100