microsoft/vscode

filters.ts' matchesSubString() performs badly in some cases

Closed this issue · 1 comments

E.g., matchesSubString('aaaaaaaaaaaax', 'aaaaaaaaaaaaaaaaaaaaaaaaa') calls _matchesSubString() 38 million times due to the backtracking being done.

This is used for the fuzzy highlighting in QuickOpen. It seems to have been there for some time, not a recent regression.

/fyi @bpasero

@chrmarti thanks for spotting this, this method is literally 5 years old I would say and probably has been used since then in many cases.