This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix StdLibraryFunctionsChecker performance issue
ClosedPublic

Authored by vsavchenko on Mar 9 2021, 2:57 AM.

Details

Summary

initFunctionSummaries lazily initializes a data structure with
function summaries for standard library functions. It is called for
every pre-, post-, and eval-call events, i.e. 3 times for each call on
the path. If the initialization doesn't find any standard library
functions in the translation unit, it will get re-tried (with the same
effect) many times even for small translation units.

For projects not using standard libraries, the speed-up can reach 50%
after this patch.

Diff Detail

Event Timeline

vsavchenko created this revision.Mar 9 2021, 2:57 AM
vsavchenko requested review of this revision.Mar 9 2021, 2:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2021, 2:57 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
martong accepted this revision.Mar 9 2021, 9:09 AM

Good catch! Thank you!

This revision is now accepted and ready to land.Mar 9 2021, 9:09 AM
steakhal accepted this revision.Mar 9 2021, 9:17 AM

For projects not using standard libraries, the speed-up can reach 50% after this patch.

Uh, that's something serious!

This revision was landed with ongoing or failed builds.Mar 9 2021, 11:44 PM
This revision was automatically updated to reflect the committed changes.