Skip to content

Improve CppAnalyzer load time by reducing Regex.Match calls.#613

Merged
KirillOsenkov merged 2 commits intoKirillOsenkov:mainfrom
yuehuang010:main
Jul 19, 2022
Merged

Improve CppAnalyzer load time by reducing Regex.Match calls.#613
KirillOsenkov merged 2 commits intoKirillOsenkov:mainfrom
yuehuang010:main

Conversation

@yuehuang010
Copy link
Copy Markdown
Contributor

Improve load times by checking keywords before matching regex.

  • String.Contains() is orders of magnitude faster than Regex.Match(). So on critical paths, quickly check if the keyword exists before running the regex.
  • CppAnalyzer speed up at least 5x as many messages are misses.
  • AddMessage speed up by 10%.

@yuehuang010 yuehuang010 changed the title Improve CppAnalyzer load time reducing Regex calls. Improve CppAnalyzer load time by reducing Regex.Match calls. Jul 19, 2022
@KirillOsenkov KirillOsenkov merged commit 3b04191 into KirillOsenkov:main Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants