Title: Fix #14113 (Slow analysis: microchip xc16 code) by glankk · Pull Request #7838 · cppcheck-opensource/cppcheck · GitHub
Open Graph Title: Fix #14113 (Slow analysis: microchip xc16 code) by glankk · Pull Request #7838 · cppcheck-opensource/cppcheck
X Title: Fix #14113 (Slow analysis: microchip xc16 code) by glankk · Pull Request #7838 · cppcheck-opensource/cppcheck
Description: Improves check times for sources with many conditionally includes files by implementing lazy loading of headers. Lazy loading is only implemented for single-config checks because cppcheck currently needs to open all possibly included headers in order to discover configs automatically. Lazy loading for automatic configurations is possible by discovering new configurations as files are loaded, and it's something I think should be implemented in the future. I've done preliminary tests showing that it significantly speeds up check times when using -f, but there are some complications that need to be figured out and it's outside the scope of this PR.
Some changes have been made to Preprocessor; since preprocessing has to be done per-file as they are included, many functions have been changed or overloaded to act on a specific file instead of all previously loaded files. Some dumps have been changed to be completed after checking is done, when the full list of included files is known.
A test has been added to test/cli/performance_test.py.
Benchmarks
Test file:
$ cat pic1.c
#include
Open Graph Description: Improves check times for sources with many conditionally includes files by implementing lazy loading of headers. Lazy loading is only implemented for single-config checks because cppcheck currently...
X Description: Improves check times for sources with many conditionally includes files by implementing lazy loading of headers. Lazy loading is only implemented for single-config checks because cppcheck currently...
Opengraph URL: https://github.com/cppcheck-opensource/cppcheck/pull/7838
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:641ba053-0d91-e409-da52-93393d660414 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D108:228A12:2337E32:31DCC11:6A4CE2F7 |
| html-safe-nonce | 532a99ca883233ff1420826779ed988437a0c6c55590de9f16fe80911893a67c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTA4OjIyOEExMjoyMzM3RTMyOjMxRENDMTE6NkE0Q0UyRjciLCJ2aXNpdG9yX2lkIjoiNzcyMjk2NzQ4NDg0ODcyNjc3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 09be32b244eea6ac4cf1c50b58bb2e1288cc34313b4efac3a4b73ede93c827b7 |
| hovercard-subject-tag | pull_request:2847343077 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/cppcheck-opensource/cppcheck/pull/7838/files |
| twitter:image | https://avatars.githubusercontent.com/u/10298420?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/10298420?s=400&v=4 |
| og:image:alt | Improves check times for sources with many conditionally includes files by implementing lazy loading of headers. Lazy loading is only implemented for single-config checks because cppcheck currently... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 299b43bca6e02ad35197ffeba30d2466846d5fb02ab96fbced5b5e6cec589fb8 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/cppcheck-opensource/cppcheck git https://github.com/cppcheck-opensource/cppcheck.git |
| octolytics-dimension-user_id | 278097703 |
| octolytics-dimension-user_login | cppcheck-opensource |
| octolytics-dimension-repository_id | 143131 |
| octolytics-dimension-repository_nwo | cppcheck-opensource/cppcheck |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 143131 |
| octolytics-dimension-repository_network_root_nwo | cppcheck-opensource/cppcheck |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c5a57f04eeb310f57c73fd6d751d957e2ca27ed2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width