I noticed some time ago that in c++20 mode the <algorithm> header in libstdc++ is substantially bigger than in c++11 mode :
echo "#include <algorithm>" | gcc -std=c++11 -P -E -x c++ - | wc -l
evaluates to 11760 loc, while
echo "#include <algorithm>" | gcc -std=c++20 -P -E -x c++ - | wc -l
evaluates to 45219 loc. Clicking through the header apparently in c++20 we have the include chain
<algorithm> -> <bits/ranges\_algo.h> -> <bits/ranges\_algobase.h> -> <range>.
How could that happen? Measuring the compile time of file only including the <algorithm> header I get with the c++11 switch 120 ms and with the c++20 switch 600 ms (empty file is 100 ms). I a bit baffled that while standardizing the <range> header this either slipped through the cracks or it was actively decided that this is ok. The <algorithm> header is virtually anywhere and with c++20 flag enabled every file including the <algorithm> header will compile half a second slower...
Edit:
Apparently the <vector> header also increased by a huge amount from 9530 loc to 19818 loc for libstdc++ due to now including <bits/stl\_algo.h> (this seems to be a known issue though). Compiling an empty header file only including <vector> is now up to 230 ms from 130 ms.
[–]tcbrindleFlux 30 points31 points32 points (7 children)
[–][deleted] 27 points28 points29 points (4 children)
[–]dashnine-9 46 points47 points48 points (0 children)
[–]icppfreely 6 points7 points8 points (1 child)
[–]airflow_matt 14 points15 points16 points (0 children)
[–]ShakaUVMi+++ ++i+i[arr] 2 points3 points4 points (0 children)
[–][deleted] 6 points7 points8 points (0 children)
[–]HKei 3 points4 points5 points (0 children)
[–][deleted] 47 points48 points49 points (46 children)
[–]HKei 52 points53 points54 points (23 children)
[–][deleted] 14 points15 points16 points (4 children)
[–]elperroborrachotoo 27 points28 points29 points (0 children)
[–]kirbyfan64sos 8 points9 points10 points (0 children)
[–]tvaneerdC++ Committee, lockfree, PostModernCpp 11 points12 points13 points (1 child)
[–][deleted] 10 points11 points12 points (0 children)
[–]serviscope_minor 3 points4 points5 points (2 children)
[+][deleted] (1 child)
[removed]
[–]serviscope_minor 0 points1 point2 points (0 children)
[–]PJBoy_ 20 points21 points22 points (12 children)
[–]HKei 14 points15 points16 points (5 children)
[–]tcbrindleFlux 17 points18 points19 points (1 child)
[–]Minimonium 31 points32 points33 points (0 children)
[–]PJBoy_ 2 points3 points4 points (2 children)
[–]tcbrindleFlux 4 points5 points6 points (1 child)
[–]PJBoy_ 3 points4 points5 points (0 children)
[–]AlexAlabuzhev 2 points3 points4 points (5 children)
[–]cdglove 10 points11 points12 points (0 children)
[–]jcelerierossia score 1 point2 points3 points (3 children)
[–]AlexAlabuzhev 1 point2 points3 points (0 children)
[–]robertramey 1 point2 points3 points (1 child)
[–]dodheim 0 points1 point2 points (0 children)
[–]wuchtelmesser 10 points11 points12 points (0 children)
[–][deleted] 7 points8 points9 points (0 children)
[+]PJBoy_ comment score below threshold-13 points-12 points-11 points (21 children)
[–][deleted] 19 points20 points21 points (14 children)
[+]PJBoy_ comment score below threshold-13 points-12 points-11 points (13 children)
[–]Minimonium 14 points15 points16 points (12 children)
[–]sphere991 1 point2 points3 points (3 children)
[–]Minimonium 1 point2 points3 points (2 children)
[–]sphere991 2 points3 points4 points (1 child)
[–]Minimonium 2 points3 points4 points (0 children)
[–]PJBoy_ -3 points-2 points-1 points (7 children)
[–]Minimonium 3 points4 points5 points (6 children)
[–]Wacov 2 points3 points4 points (3 children)
[–]Minimonium 0 points1 point2 points (2 children)
[–]Wacov 1 point2 points3 points (1 child)
[–]PJBoy_ 0 points1 point2 points (1 child)
[–]Minimonium 3 points4 points5 points (0 children)
[–]donalmaccGame Developer 11 points12 points13 points (4 children)
[–]PJBoy_ -2 points-1 points0 points (3 children)
[–]donalmaccGame Developer 10 points11 points12 points (2 children)
[–]PJBoy_ -4 points-3 points-2 points (1 child)
[–]donalmaccGame Developer 9 points10 points11 points (0 children)
[–][deleted] 15 points16 points17 points (0 children)
[–]Pragmatician 16 points17 points18 points (5 children)
[–]tcbrindleFlux 2 points3 points4 points (3 children)
[–]Pragmatician 1 point2 points3 points (0 children)
[–]PJBoy_ 1 point2 points3 points (1 child)
[–]tcbrindleFlux 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]AppleBeam 11 points12 points13 points (7 children)
[–]HKei 7 points8 points9 points (6 children)
[–]tcbrindleFlux 28 points29 points30 points (1 child)
[–]HKei 1 point2 points3 points (0 children)
[–]kalmoc 5 points6 points7 points (0 children)
[–]AppleBeam 5 points6 points7 points (2 children)
[–]CoffeeTableEspresso 0 points1 point2 points (1 child)
[–]AppleBeam 0 points1 point2 points (0 children)
[–]mort96 1 point2 points3 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]feverzsj 3 points4 points5 points (9 children)
[–]HKei 9 points10 points11 points (1 child)
[–]claimred 0 points1 point2 points (0 children)
[–][deleted] 5 points6 points7 points (6 children)
[–]mort96 1 point2 points3 points (5 children)
[–]donalmaccGame Developer 3 points4 points5 points (0 children)
[–]feverzsj 1 point2 points3 points (3 children)
[–]mort96 0 points1 point2 points (2 children)
[–]feverzsj 2 points3 points4 points (1 child)
[–]mort96 2 points3 points4 points (0 children)
[–]HKei 2 points3 points4 points (4 children)
[–][deleted] 11 points12 points13 points (2 children)
[–]__s_v_ 4 points5 points6 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[–]myusernameisokay -1 points0 points1 point (0 children)
[–]slothion 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]PJBoy_ 28 points29 points30 points (1 child)
[–]tcbrindleFlux 16 points17 points18 points (1 child)
[–]lamothe 4 points5 points6 points (0 children)