<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63308>63308</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy misc-const-correctness has performance issues with std::format
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cedric-ca
</td>
</tr>
</table>
<pre>
Hi,
We encounter performance issues with clang-tidy misc-const-correctness when we introduced std::format.
I tried LLVM 16.0.0, 16.0.3 and 16.0.6.
The file I tested has only one std::format:
const double toto = 1.0;
std::string s = std::format("text I want = {}", toto);
vs
std::string s = "text I want = " + std::to_string(toto);
[std_format_performance.txt](https://github.com/llvm/llvm-project/files/11747920/std_format_performance.txt)
[without_std_format_performance.txt](https://github.com/llvm/llvm-project/files/11747921/without_std_format_performance.txt)
Cédric
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0U01v40YM_TXUhbAgUR59HHTwB4QGSG9FezSkGdqaQp4JNFSc_PtCUusERje7e9gLhwfyvcchXxuCvTjmGtQe1DFqJ-n9WGs2o9Ub3UadN-_1bxboAMkRkt0a_2Jkp_3khEd84fHsx2vrNKMNYeKANys96qF1l41Y845XG_RGexdko_04shbHIeCtZ4c3Rutk9GbSbDCIgWwH2W6BlHjle0IZLRt8fv7zd0zzOIkToMOaZdg6s6Z5_FnkHz3j2Q6MTygchA32bUDvhnf0jh-Z5nxpW2Si8VM3MIoXj5AdMY0TyPZrxb0zyGjdBcNS8YhHJRAJvwk-4a11shRBsYfiCESz_BkcqLrjvgb8iuD_4IgQaP_BLf609gCVj_D_RrUPYk6ryNOn3cXyJqCOQGUv8hJmPGqAmouVfupi7a9AzTC8_vdsXkb_N2sBauZfDkBNmhbboqIEqPmCg6q7kvlO_CSnX60oBWp-gOuubIkHOGSwq2YnRKbOTJVVbcR1mpd5oYpSqaiv85x0WaVFmZIytG0pOeuMjMq6szJFco5sTQllSZ5uU6USpeJUd9RllHZV2aVdSbBN-NraIZ4niP14iRYP1XmWJWU0tB0PYXEnkePbarD5ftQxGutl6m66BNgmgw0SPlDEysD19z04e-JbDn446Wgah_qnV7ECAjXLRP8EAAD__wS4Z6E">