Reduce the overhead of unsafe buffers plugin.

Calling setSeverityForGroup significantly increases the execution time
of clang. My best guess is that when you call setSeverityForGroup,
it, for whatever reason, performs the diagnostics on the clang AST.

This, in turn, means that the AST of the clang modules are traversed,
undoing the advantages of clang modules being lazy.

With the combination of this and crrev.com/c/7149139, the total cost of cxx actions in an offline build went from a 20% overhead to a 13% overhead.

Total CXX action time with plugins: 602107.68s
Total CXX action time without plugins: 532515.82s
Ratio (With/Without): 1.13

Bug: 460270284
Change-Id: I85abd75512136441a9cacbd236f957356a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7149658
Reviewed-by: Takuto Ikuta <[email protected]>
Reviewed-by: Hans Wennborg <[email protected]>
Commit-Queue: Matt Stark <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1546234}
NOKEYCHECK=True
GitOrigin-RevId: c48321321cdbb3aa5b8b78621fec1b01df1e8b6e
2 files changed