Skip to content

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 11, 2025

The new benchmarking bot is experimental and is very rough on the edges.

@ldionne ldionne requested a review from a team as a code owner September 11, 2025 23:58
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 11, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

The new benchmarking bot is experimental and is very rough on the edges.


Full diff: https://github.com/llvm/llvm-project/pull/158167.diff

1 Files Affected:

  • (modified) libcxx/docs/TestingLibcxx.rst (+10)
diff --git a/libcxx/docs/TestingLibcxx.rst b/libcxx/docs/TestingLibcxx.rst
index 44463385b81a7..227791031bab0 100644
--- a/libcxx/docs/TestingLibcxx.rst
+++ b/libcxx/docs/TestingLibcxx.rst
@@ -531,6 +531,16 @@ Finally, use ``compare-benchmarks`` to compare both:
 The ``compare-benchmarks`` script provides some useful options like creating a chart to easily visualize
 differences in a browser window. Use ``compare-benchmarks --help`` for details.
 
+Additionally, adding a comment of the following form to a libc++ PR will cause the specified benchmarks to be run
+on our pre-commit CI infrastructure and the results to be reported in the PR by our CI system:
+
+.. code-block::
+
+    /libcxx-bot benchmark <path/to/benchmark1.bench.cpp> <path/to/benchmark2.bench.cpp> ...
+
+Note that this is currently experimental and the results should not be relied upon too strongly, since
+we do not have dedicated hardware to run the benchmarks on.
+
 .. _`Google Benchmark`: https://github.com/google/benchmark
 
 .. _testing-hardening-assertions:

@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2025

/libcxx-bot benchmark libcxx/test/benchmarks/containers/sequence/vector.bench.cpp

Benchmark results:

@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2025

Let's hope it works like it did during my testing :)

CI job running the benchmarks: https://github.com/llvm/llvm-project/actions/runs/17660356184/job/50192377946

@ldionne ldionne force-pushed the review/document-new-performance-buildbot branch from 7482317 to def5b8d Compare September 12, 2025 00:21
@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2025

Another try (https://github.com/llvm/llvm-project/actions/runs/17660748509)

/libcxx-bot benchmark libcxx/test/benchmarks/join_view.bench.cpp libcxx/test/benchmarks/hash.bench.cpp

Benchmark results:
Benchmark                              Baseline    Candidate    Difference    % Difference
-----------------------------------  ----------  -----------  ------------  --------------
BM_Hash/uint32_random_std_hash/1024      365.61       360.75         -4.86           -1.33
BM_Hash/uint32_top_std_hash/1024         361.19       364.37          3.18            0.88
BM_join_view_deques/0                     17.38        17.46          0.08            0.48
BM_join_view_deques/1                     26.82        23.37         -3.45          -12.86
BM_join_view_deques/1024                7131.67      7464.43        332.76            4.67
BM_join_view_deques/2                     28.42        29.57          1.14            4.02
BM_join_view_deques/4000               38547.76     40118.81       1571.05            4.08
BM_join_view_deques/4096               38573.13     40538.24       1965.11            5.09
BM_join_view_deques/512                 3286.41      3305.54         19.12            0.58
BM_join_view_deques/5500               52512.31     54475.28       1962.97            3.74
BM_join_view_deques/64                   365.92       380.03         14.11            3.86
BM_join_view_deques/64000            1073769.29   1113218.74      39449.45            3.67
BM_join_view_deques/65536            1314140.02   1178116.36    -136023.66          -10.35
BM_join_view_deques/70000            1383531.81   1248538.94    -134992.87           -9.76
BM_join_view_in_vectors/0                  7.20         7.38          0.18            2.56
BM_join_view_in_vectors/1                 11.84        11.86          0.02            0.16
BM_join_view_in_vectors/1024            3651.47      3843.23        191.76            5.25
BM_join_view_in_vectors/2                 10.29        10.32          0.03            0.31
BM_join_view_in_vectors/4000           15870.08     15795.96        -74.12           -0.47
BM_join_view_in_vectors/4096           16570.41     16101.39       -469.02           -2.83
BM_join_view_in_vectors/512             1782.94      1811.68         28.74            1.61
BM_join_view_in_vectors/5500           22179.16     21955.29       -223.86           -1.01
BM_join_view_in_vectors/64               228.80       227.74         -1.07           -0.47
BM_join_view_in_vectors/64000         273701.40    268783.97      -4917.42           -1.80
BM_join_view_in_vectors/65536         282101.49    265953.20     -16148.29           -5.72
BM_join_view_in_vectors/70000         302118.69    296550.98      -5567.71           -1.84
BM_join_view_out_vectors/0                 0.94         0.94          0.00            0.24
BM_join_view_out_vectors/1                 5.03         4.99         -0.04           -0.89
BM_join_view_out_vectors/1024           3886.51      3899.05         12.54            0.32
BM_join_view_out_vectors/2                 8.13         8.10         -0.03           -0.36
BM_join_view_out_vectors/4000          16823.60     16444.73       -378.87           -2.25
BM_join_view_out_vectors/4096          16532.58     16736.68        204.10            1.23
BM_join_view_out_vectors/512            1942.38      2017.62         75.24            3.87
BM_join_view_out_vectors/5500          27521.01     22572.17      -4948.85          -17.98
BM_join_view_out_vectors/64              245.30       246.12          0.82            0.33
BM_join_view_out_vectors/64000        278520.87    270400.70      -8120.17           -2.92
BM_join_view_out_vectors/65536        285918.99    278413.15      -7505.85           -2.63
BM_join_view_out_vectors/70000        345259.40    364763.14      19503.74            5.65

Benchmark results:
Benchmark                              Baseline    Candidate    Difference    % Difference
-----------------------------------  ----------  -----------  ------------  --------------
BM_Hash/uint32_random_std_hash/1024      362.07       361.58         -0.49           -0.14
BM_Hash/uint32_top_std_hash/1024         364.07       361.26         -2.81           -0.77
BM_join_view_deques/0                     17.46        17.60          0.14            0.81
BM_join_view_deques/1                     26.38        25.95         -0.43           -1.65
BM_join_view_deques/1024                7489.33      6996.64       -492.69           -6.58
BM_join_view_deques/2                     29.06        28.54         -0.53           -1.81
BM_join_view_deques/4000               38180.62     38634.17        453.55            1.19
BM_join_view_deques/4096               39772.57     37584.40      -2188.17           -5.50
BM_join_view_deques/512                 3275.73      3363.14         87.41            2.67
BM_join_view_deques/5500               50357.19     50274.21        -82.98           -0.16
BM_join_view_deques/64                   357.79       370.45         12.66            3.54
BM_join_view_deques/64000            1123757.58   1119194.21      -4563.37           -0.41
BM_join_view_deques/65536            1196630.42   1167029.53     -29600.89           -2.47
BM_join_view_deques/70000            1269812.91   1273125.54       3312.64            0.26
BM_join_view_in_vectors/0                  7.15         7.07         -0.08           -1.06
BM_join_view_in_vectors/1                 11.82        11.81         -0.02           -0.13
BM_join_view_in_vectors/1024            3660.35      3817.84        157.48            4.30
BM_join_view_in_vectors/2                 10.27        10.43          0.16            1.57
BM_join_view_in_vectors/4000           15296.94     15259.36        -37.57           -0.25
BM_join_view_in_vectors/4096           15836.90     16188.85        351.96            2.22
BM_join_view_in_vectors/512             1847.68      1827.98        -19.71           -1.07
BM_join_view_in_vectors/5500           21232.40     22666.14       1433.73            6.75
BM_join_view_in_vectors/64               244.47       229.64        -14.83           -6.07
BM_join_view_in_vectors/64000         270758.56    290656.36      19897.80            7.35
BM_join_view_in_vectors/65536         272466.83    342938.63      70471.80           25.86
BM_join_view_in_vectors/70000         300975.87    318153.81      17177.94            5.71
BM_join_view_out_vectors/0                 0.93         0.94          0.01            0.90
BM_join_view_out_vectors/1                 5.01         5.24          0.22            4.45
BM_join_view_out_vectors/1024           4030.18      4214.43        184.25            4.57
BM_join_view_out_vectors/2                 8.12         8.17          0.05            0.65
BM_join_view_out_vectors/4000          16229.09     18186.54       1957.45           12.06
BM_join_view_out_vectors/4096          16235.89     16243.56          7.66            0.05
BM_join_view_out_vectors/512            1938.80      1971.62         32.83            1.69
BM_join_view_out_vectors/5500          22165.49     21994.26       -171.23           -0.77
BM_join_view_out_vectors/64              243.84       245.78          1.95            0.80
BM_join_view_out_vectors/64000        284885.29    273144.22     -11741.07           -4.12
BM_join_view_out_vectors/65536        332729.29    280192.07     -52537.22          -15.79
BM_join_view_out_vectors/70000        318512.57    334174.70      15662.13            4.92

@ldionne
Copy link
Member Author

ldionne commented Sep 12, 2025

/libcxx-bot benchmark libcxx/test/benchmarks

@ldionne ldionne merged commit 0058cc8 into llvm:main Sep 15, 2025
77 of 79 checks passed
@ldionne ldionne deleted the review/document-new-performance-buildbot branch September 15, 2025 12:44
itzexpoexpo pushed a commit to itzexpoexpo/llvm-project that referenced this pull request Sep 21, 2025
… bot (llvm#158167)

The new benchmarking bot is experimental and is very rough on the edges.
SeongjaeP pushed a commit to SeongjaeP/llvm-project that referenced this pull request Sep 23, 2025
… bot (llvm#158167)

The new benchmarking bot is experimental and is very rough on the edges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants