[Bug c++/86091] [fold expression] Slow compile time and high memory usage compared to initializer_list folds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86091 Jonathan Wakely changed: What|Removed |Added Resolution|FIXED |WORKSFORME --- Comment #3 from Jonathan Wakely --- (In reply to Vasili Burdo from comment #0) > I tried multiple GCC versions starting from 5.3 to 8.0.0 on Ubuntu and > Windows (MINGW) all of them have the same problem. How did you test it with 5.3 when it doesn't even support fold expressions? I can't reproduce the slowness with any version of GCC at all. tmp$ time ~/gcc/6.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.284s user0m0.234s sys 0m0.048s tmp$ time ~/gcc/6.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.267s user0m0.235s sys 0m0.028s tmp$ time ~/gcc/6.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m1.231s user0m0.271s sys 0m0.081s tmp$ time ~/gcc/6.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.298s user0m0.225s sys 0m0.037s tmp$ time ~/gcc/6.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m1.260s user0m0.287s sys 0m0.075s tmp$ time ~/gcc/6.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.317s user0m0.230s sys 0m0.034s tmp$ time ~/gcc/6.4.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.280s user0m0.239s sys 0m0.038s tmp$ time ~/gcc/6.4.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.264s user0m0.226s sys 0m0.035s tmp$ time ~/gcc/7.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.313s user0m0.254s sys 0m0.056s tmp$ time ~/gcc/7.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.304s user0m0.266s sys 0m0.036s tmp$ time ~/gcc/7.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.299s user0m0.247s sys 0m0.050s tmp$ time ~/gcc/7.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.281s user0m0.245s sys 0m0.034s tmp$ time ~/gcc/7.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.574s user0m0.534s sys 0m0.036s tmp$ time ~/gcc/7.3.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.632s user0m0.592s sys 0m0.037s tmp$ time ~/gcc/8.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.334s user0m0.305s sys 0m0.027s tmp$ time ~/gcc/8.1.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.652s user0m0.610s sys 0m0.040s tmp$ time ~/gcc/8.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc -DBUG real0m0.169s user0m0.140s sys 0m0.026s tmp$ time ~/gcc/8.2.0/bin/g++ -std=gnu++1z -Wall -Wextra 86091.cc real0m0.296s user0m0.249s sys 0m0.043s
[Bug c++/86091] [fold expression] Slow compile time and high memory usage compared to initializer_list folds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86091 Vasili Burdo changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #2 from Vasili Burdo --- Confirmed. As of current git (master 571ee70a6d4), fold expression compliation is fast.
[Bug c++/86091] [fold expression] Slow compile time and high memory usage compared to initializer_list folds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86091 --- Comment #1 from Richard Biener --- I can't reproduce the slowness. > /usr/bin/time g++-8 t.C -std=gnu++1z -Wall -Wextra 0.23user 0.04system 0:00.27elapsed 99%CPU (0avgtext+0avgdata 44028maxresident)k 0inputs+1568outputs (0major+14354minor)pagefaults 0swaps > /usr/bin/time g++-8 t.C -std=gnu++1z -Wall -Wextra -DBUG 0.18user 0.03system 0:00.22elapsed 100%CPU (0avgtext+0avgdata 30476maxresident)k 0inputs+1408outputs (0major+10204minor)pagefaults 0swaps