Title: astutils.h: use pre-sized `SmallVector` in `visitAstNodes()` by firewave · Pull Request #3919 · cppcheck-opensource/cppcheck · GitHub
Open Graph Title: astutils.h: use pre-sized `SmallVector` in `visitAstNodes()` by firewave · Pull Request #3919 · cppcheck-opensource/cppcheck
X Title: astutils.h: use pre-sized `SmallVector` in `visitAstNodes()` by firewave · Pull Request #3919 · cppcheck-opensource/cppcheck
Description: This is the first of two PR introducing the usage of SmallVector in our code. I adjusted the value locally based on profiling it with callgrind. When using Clang and Boost the indicator that we need to increase the size of the vector are boost::container::vec_iterator<> boost::container::vector<>::priv_forward_range_insert_no_capacity<>(...) and operator delete(void*) calls in findAstNode(...). When using no Boost and reserve() the indicator is amount of additional operator new(...) and operator delete(...) compared to the actual calls of findAstNode(...). Update: With findAstNode() now being inlined it is now harder to trace this. You now need to follow the operator new() or operator delete() but you won't have a function or proper call count to compare against. It seem like memcpy@GLIBC_2.2.5 is now the indicator that the vector is being expanded and needs to reserve more space. I still need to run a bigger test to see if we might need to increase the count even more. Here's some numbers for a -O2 build using callgrind with --enable=all --inconclusive on the mame_regtest project, DISABLE_VALUEFLOW=1. Clang 13 2,263,092,948 - std::vector 2,242,113,164 - std::vector (reserve(8)) 2,263,074,159 - SmallVector (no Boost / size 8) 2,242,113,077 - SmallVector (no Boost / size 8 / reserve(8)) 2,162,604,179 - SmallVector (Boost 1.74 / size 8) 2,167,203,248 - SmallVector (Boost 1.74 / size 8 / reserve(8)) GCC values coming soon. I will file a ticket about the GCC difference soon. Updated numbers below.
Open Graph Description: This is the first of two PR introducing the usage of SmallVector in our code. I adjusted the value locally based on profiling it with callgrind. When using Clang and Boost the indicator that we nee...
X Description: This is the first of two PR introducing the usage of SmallVector in our code. I adjusted the value locally based on profiling it with callgrind. When using Clang and Boost the indicator that we nee...
Opengraph URL: https://github.com/cppcheck-opensource/cppcheck/pull/3919
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:acab61c4-d6da-4df9-5cda-ac772b5a36c6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A2B8:320E86:75AAF1:ABE02A:6A4E1478 |
| html-safe-nonce | 8c3111cd3f2af53c85376bef04068bebc4b922110585236cea24c7023730cb85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkI4OjMyMEU4Njo3NUFBRjE6QUJFMDJBOjZBNEUxNDc4IiwidmlzaXRvcl9pZCI6Ijg3Nzg1MjE3ODQ1MDI1ODg1MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 33dd4dbffa4109870ae9e894adf60b9746a2ca2720446291a060416cc03fd989 |
| hovercard-subject-tag | pull_request:884138295 |
| 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/3919/files |
| twitter:image | https://avatars.githubusercontent.com/u/242857?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/242857?s=400&v=4 |
| og:image:alt | This is the first of two PR introducing the usage of SmallVector in our code. I adjusted the value locally based on profiling it with callgrind. When using Clang and Boost the indicator that we nee... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| 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 | ea9187571e3edc5f2780f750631138669441ca50 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width