this post was submitted on 05 Sep 2023
6 points (87.5% liked)

C++

1755 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
 

I'm wondering if there are any serious benchmarks that were done recently to show whether C++20 concepts lead to considerable speed-ups in compilation times of templates-heavy code compared to pre-C++20 SFINAE. Would be nice if there was a breakdown by compiler vendor to see which compilers profit the most from replacing SFINAE with concepts.

Anecdotes are of course also welcome.

EDIT(more context): I have a large codebase using lots of expression templates that I wrote in C++17 because at the time our linting tools had incomplete C++20 support, and I used lots of SFINAE too. Right now the tools have evolved and I can afford to use C++20 features now, so I need to guesstimate how much I'm going to gain in compilation times before I go through the large codebase and replace the SFINAE with concepts.

top 1 comments
sorted by: hot top controversial new old
[–] lysdexic 3 points 1 year ago

I dare say that there would be no better measuring stick than you doing a proof of concept with your own codebase, and extrapolate from there. There's a likelihood that the impact on build times will be sensitive to parameters such as how your implementation was/is put together, and what compiler you're using.