Uh oh!
There was an error while loading. Please reload this page.
Cache parsed path mapping patterns - #44078
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| export function tryParsePattern(pattern: string): Pattern | undefined { | ||
| // This should be verified outside of here and a proper error thrown. | ||
| Debug.assert(hasZeroOrOneAsteriskCharacter(pattern)); |
There was a problem hiding this comment.
Why did we remove the assert or requirement that users of this have this checked already?
There was a problem hiding this comment.
The check was duplicated between the caller and the assert (none needed it for other reasons - they were just doing it to satisfy this requirement). I didn't think the requirement made the API conceptually clearer or the implementation simpler - on the contrary, I thought it was preferable to gather all the checks into a single function.
There was a problem hiding this comment.
Perhaps your question was "what happened to the proper error?". It's still there - an undefined result now indicates that an error should be reported.
If a project has many of them (e.g. 1800), parsing the patterns repeatedly can take up a lot of time.
8a89af5 to
00b9ccdCompareAndrew Casey (amcasey)
commented
May 25, 2021
Force push is a rebase onto master. Updates to follow. |
Andrew Casey (amcasey)
commented
May 26, 2021
TypeScript Bot (@typescript-bot) pack this |
Heya Andrew Casey (@amcasey), I've started to run the tarball bundle task on this PR at 0435303. You can monitor the build here. |
Hey Andrew Casey (@amcasey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
If a project has many of them (e.g. 1800), parsing the patterns repeatedly can take up a lot of time.
Specifically,
getOwnKeysandhasZeroOrOneAsteriskCharacterwere showing up as self-time hotspots.