HomePhabricator

clang-tidy: Add more performance checks

Description

clang-tidy: Add more performance checks

Summary:

clang-tidy: Add performance-faster-string-find check

https://clang.llvm.org/extra/clang-tidy/checks/performance/faster-string-find.html

https://github.com/bitcoin/bitcoin/pull/26642/commits/516b75f66ec3ba7495fc028c750937bd66cc9bba

clang-tidy: Add performance-type-promotion-in-math-fn check

https://clang.llvm.org/extra/clang-tidy/checks/performance/type-promotion-in-math-fn.html

https://github.com/bitcoin/bitcoin/pull/26642/commits/24004372302adfc0e7cb36f8db6830694bf050e9

clang-tidy: Exclude performance-* checks rather including themi

https://github.com/bitcoin/bitcoin/pull/26642/commits/03ec5b6f9ca3af28c9ce25cf2393e28ae852d808

Also address a performance-inefficient-algorithm warning in minerfund.cpp:
https://clang.llvm.org/extra/clang-tidy/checks/performance/inefficient-algorithm.html

This concludes backport of core#26642
Depends on D18072

Test Plan: ninja all check-all bench-bitcoin

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18076

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Mar 26 2023, 19:17
PiRKCommitted on Mon, May 12, 18:39
PiRKPushed on Mon, May 12, 18:39
Reviewer
Restricted Project
Differential Revision
D18076: clang-tidy: Add more performance checks
Parents
rABC4faf6bb42918: clang-tidy: Add `performance-inefficient-vector-operation` check
Branches
Unknown
Tags
Unknown