microsoft / microsoft/TypeScript
Investigate Wildcard Matching Performance
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
Recently I investigated optimizing path matching in https://github.com/microsoft/TypeScript/pull/59048 since an internal project had over 5500 path mapping entries.
@dmichon-msft brought up a similar issue they had with a project where using wildcard entries in include caused a 14 second slowdown in their builds. Some of the same optimizations might be usable in include/exclude globbing, or we could adapt a different solution with a radix tree or a similar data structure (e.g. https://github.com/microsoft/rushstack/blob/1bf90f890d59de5babaf07ccc2551b77df704b18/libraries/rush-lib/src/logic/LookupByPath.ts as pointed out at https://github.com/microsoft/TypeScript/pull/59048#discussion_r1657649883).
Contributor 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.
Research direction
Review the path-matching optimization in PR 59048, then trace the include/exclude globbing path. Reproduce the reported slowdown with roughly 5,500 wildcard entries and compare a suitable optimization, such as the referenced radix-tree approach. Done means a measured performance improvement with behavior preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100