[PATCH] D124446: [clang-tidy] Add the misc-discarded-return-value check

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 22 09:14:39 PDT 2022


whisperity added a comment.

In D124446#3521619 <https://reviews.llvm.org/D124446#3521619>, @whisperity wrote:

> @aaron.ballman [...] I think I can put in a measurement job [...]

I've rerun the experiment **on another computer** (compared to the results shown in the inline comments) from scratch. The measurement environment had a 4core/8thread CPU with 16 GiB RAM. There were no OOM situations.
LLVM was self-built by me, in a //Release// build (with `-DBUILD_SHARED_LIBS=ON`), linked with `ld.gold`.

The analysis was executed with the //"core checks"// list consisting of **all** `bugprone` (excluding bugprone-unchecked-optional-access <http://llvm.org/PR55530>), `misc`, `modernize`, `performance`, `portability`, and `readability`; with `-wall -wextra -weverything` and the //Clang Static Analyser// turned **off**. (This means that purely guidelines-related checks were also not run.)

- //BURV//: `bugprone-unused-return-value`
- //MDRV//: `misc-discarded-return-value`

Below times are the **full** analysis, for the project, at `-j8`, including the parsing and whatnot. Times are `h:mm:ss.fff`, real-world elapsed (//"wall"//) time.
I've also utilised Tidy's `--export-check-profile` feature. I've run the analysis results through CSA-Testbench <http://github.com/Xazax-hun/csa-testbench/pull/53> to generate some graphs, attached for each project. I know they look ugly, but I tried to make the colours as consistent between projects and executions as possible. (The two highlighted checks, //BURV// and //MDRV// are split out of the chart and get consistent bright colours. The rest of the colours for every check is calculated from the hashing of the check's full name, and as such, the results should be comparable even across projects.) The input for each entry in the chart is the summed up (for the entire project) `.wall` time, per check, as reported by Tidy in the JSONs it emitted.

| **Project**                                                                                             | **Core checks** | Core //+ BURV// | Core //+ MDRV// | Core + **//BURV//, //MDRV//** | **only** //BURV// | **only** //MDRV// | **only** //BURV//, //MDRV// | **Chart** |
| Bitcoin <http://github.com/bitcoin/bitcoin/tree/v0.20.1>                                                | 0:13:52.088     | 0:14:16.517     | 0:14:54.725     | 0:15:18.858                   | 0:01:35.215       | 0:02:15.282       | -                           | F23156342: bitcoin.png <https://reviews.llvm.org/F23156342>         |
| CodeChecker ld-logger <http://github.com/Ericsson/codechecker/tree/v6.17.0/analyzer/tools/build-logger> | 0:00:01.055     | 0:00:01.033     | 0:00:01.098     | 0:00:01.132                   | 0:00:00.334       | 0:00:00.401       | -                           | F23156348: codechecker.png <https://reviews.llvm.org/F23156348>         |
| Contour Terminal Emulator <http://github.com/contour-terminal/contour/tree/v0.2.0.173>                  | 0:12:54.247     | 0:13:10.559     | 0:13:23.222     | 0:13:49.406                   | 0:01:27.554       | 0:01:57.877       | -                           | F23156351: contour.png <https://reviews.llvm.org/F23156351>         |
| cURL <http://github.com/curl/curl/tree/curl-7_66_0>                                                     | 0:01:47.186     | 0:01:50.722     | 0:01:48.436     | 0:01:51.260                   | 0:00:16.982       | 0:00:22.576       | -                           | F23156353: curl.png <https://reviews.llvm.org/F23156353>         |
| FFmpeg <http://github.com/FFmpeg/FFmpeg/tree/n4.3.1>                                                    | 0:08:45.986     | 0:09:09.407     | 0:09:20.924     | 0:09:20.310                   | 0:01:03.081       | 0:01:28.070       | -                           | F23156355: ffmpeg.png <https://reviews.llvm.org/F23156355>         |
| libWebm <http://github.com/webmproject/libwebm/tree/libwebm-1.0.0.27>                                   | 0:00:12.737     | 0:00:13.759     | 0:00:13.775     | 0:00:14.609                   | 0:00:01.220       | 0:00:01.872       | -                           | F23156357: libwebm.png <https://reviews.llvm.org/F23156357>         |
| LLVM (Clang + CTE) <http://github.com/llvm/llvm-project/tree/llvmorg-12.0.0>                            | 🏁 DNF           | -               | -               | -                             | 0:59:29.017       | 1:21:39.916       | 1:30:37.199                 | F23156359: llvm-project.png <https://reviews.llvm.org/F23156359>         |
| MemcacheD <http://github.com/memcached/memcached/tree/1.6.8>                                            | 0:00:07.288     | 0:00:09.124     | 0:00:07.981     | 0:00:11.056                   | 0:00:01.561       | 0:00:01.938       | -                           | F23156361: memcached.png <https://reviews.llvm.org/F23156361>         |
| MongoDB <http://github.com/mongodb/mongo/tree/r4.4.6>                                                   | 🚩 DNS           | -               | -               | -                             | -                 | -                 | -                           | F23156364: mongo.png <https://reviews.llvm.org/F23156364>         |
| Monomux <http://github.com/whisperity/MonoMux/tree/76327d4362047c5e9073530a0e791e8fbdb3c56f>            | 0:01:04.460     | 0:01:07.907     | 0:01:09.834     | 0:01:10.736                   | 0:00:07.291       | 0:00:10.771       | -                           | F23156366: monomux.png <https://reviews.llvm.org/F23156366>         |
| OpenSSL <http://github.com/openssl/openssl/tree/openssl-3.0.0-alpha7>                                   | 0:15:53.949     | 0:15:59.860     | 0:16:41.001     | 0:16:52.079                   | 0:01:15.787       | 0:02:00.273       | -                           | F23156369: openssl.png <https://reviews.llvm.org/F23156369>         |
| PostgreSQL <http://github.com/postgres/postgres/tree/REL_13_0>                                          | 0:07:24.553     | 0:07:30.343     | 0:00:30.936     | 0:00:33.487                   | 0:00:52.274       | 0:00:06.212       | -                           | F23156372: postgres.png <https://reviews.llvm.org/F23156372>         |
| ProtoBuf <http://github.com/protocolbuffers/protobuf/tree/v3.13.0>                                      | 0:14:18.421     | 0:14:22.826     | 0:15:04.178     | 0:15:10.623                   | 0:01:07.486       | 0:01:38.423       | -                           | F23156374: protobuf.png <https://reviews.llvm.org/F23156374>         |
| QtBase <http://github.com/qt/qtbase/tree/v6.2.0>                                                        | 🏁 DNF           | -               | -               | -                             | 0:15:52.545       | 0:21:42.306       | 0:24:41.932                 | F23156378: qtbase.png <https://reviews.llvm.org/F23156378>         |
| Redis <http://github.com/antirez/redis/tree/6.2.6>                                                      | 0:00:30.738     | 0:00:31.956     | 0:01:14.693     | 0:01:17.653                   | 0:00:02.707       | 0:00:12.320       | -                           | F23156381: redis.png <https://reviews.llvm.org/F23156381>         |
| SQLite <http://github.com/sqlite/sqlite/tree/version-3.33.0>                                            | 0:05:14.670     | 0:05:08.216     | 0:05:24.878     | 0:05:12.105                   | 0:00:02.171       | 0:00:03.658       | -                           | F23156383: sqlite.png <https://reviews.llvm.org/F23156383>         |
| TinyXML <http://github.com/leethomason/tinyxml2/tree/8.0.0>                                             | 0:00:01.908     | 0:00:01.950     | 0:00:02.004     | 0:00:01.996                   | 0:00:00.193       | 0:00:00.254       | -                           | F23156386: tinyxml2.png <https://reviews.llvm.org/F23156386>         |
| tmux <http://github.com/tmux/tmux/tree/2.6>                                                             | 0:00:20.434     | 0:00:21.187     | 0:00:21.592     | 0:00:22.735                   | 0:00:03.662       | 0:00:05.371       | -                           | F23156388: tmux.png <https://reviews.llvm.org/F23156388>         |
| Twin <http://github.com/cosmos72/twin/tree/v0.8.1>                                                      | 0:00:19.101     | 0:00:20.449     | 0:00:21.926     | 0:00:22.226                   | 0:00:02.354       | 0:00:03.278       | -                           | F23156394: twin.png <https://reviews.llvm.org/F23156394>         |
| Vim <http://github.com/vim/vim/tree/v8.2.1920>                                                          | 0:00:03.449     | 0:00:03.440     | 0:00:03.617     | 0:00:03.642                   | 0:00:00.338       | 0:00:00.465       | -                           | F23156396: vim.png <https://reviews.llvm.org/F23156396>         |
| Xerces-C <http://github.com/apache/xerces-c/tree/v3.2.3>                                                | 0:06:05.067     | 0:06:05.060     | 0:06:14.002     | 0:06:17.829                   | 0:00:19.966       | 0:00:27.916       | -                           | F23156399: xerces.png <https://reviews.llvm.org/F23156399>         |
|



---

The raw results (summed together per check) are available in this generated HTML, together with an interactive version of the graph: F23156432: misc-discarded-return-value_and_friends_csatestbench-stats.html <https://reviews.llvm.org/F23156432>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124446/new/

https://reviews.llvm.org/D124446



More information about the cfe-commits mailing list