This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58999] sizeof ...(T) is very slow than clang


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58999

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
--enable-checking=release makes quite a big difference

$ time ~/gcc/4.x/bin/g++  -std=c++11 -c t.cc -ftime-report

Execution times (seconds)
 phase setup             :   0.00 ( 0%) usr   0.01 ( 2%) sys   0.05 ( 0%) wall 
  1323 kB ( 0%) ggc
 phase parsing           :  12.84 (100%) usr   0.44 (96%) sys  13.31 (99%) wall
1422475 kB (100%) ggc
 phase opt and generate  :   0.00 ( 0%) usr   0.01 ( 2%) sys   0.09 ( 1%) wall 
    42 kB ( 0%) ggc
 phase last asm          :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 |overload resolution    :   0.03 ( 0%) usr   0.01 ( 2%) sys   0.03 ( 0%) wall 
  1153 kB ( 0%) ggc
 garbage collection      :   0.19 ( 1%) usr   0.00 ( 0%) sys   0.19 ( 1%) wall 
     0 kB ( 0%) ggc
 parser function body    :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     1 kB ( 0%) ggc
 template instantiation  :  12.65 (99%) usr   0.44 (96%) sys  13.11 (97%) wall
1422149 kB (100%) ggc
 tree gimplify           :   0.00 ( 0%) usr   0.01 ( 2%) sys   0.00 ( 0%) wall 
     0 kB ( 0%) ggc
 tree STMT verifier      :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 expand                  :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall 
     1 kB ( 0%) ggc
 LRA non-specific        :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 shorten branches        :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall 
     0 kB ( 0%) ggc
 symout                  :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 rest of compilation     :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.03 ( 0%) wall 
     2 kB ( 0%) ggc
 TOTAL                 :  12.84             0.46            13.50           
1423858 kB
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --enable-checking=release to disable checks.

real    0m14.014s
user    0m12.853s
sys     0m0.528s

$ time ~/gcc/4.x-release/bin/g++  -std=c++11 -c t.cc -ftime-report

Execution times (seconds)
 phase setup             :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.05 ( 1%) wall 
  1374 kB ( 0%) ggc
 phase parsing           :   7.40 (100%) usr   0.28 (100%) sys   7.71 (98%)
wall 1422475 kB (100%) ggc
 phase opt and generate  :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.05 ( 1%) wall 
    42 kB ( 0%) ggc
 phase last asm          :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 |overload resolution    :   0.06 ( 1%) usr   0.01 ( 4%) sys   0.07 ( 1%) wall 
  1153 kB ( 0%) ggc
 garbage collection      :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 parser (global)         :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall 
   309 kB ( 0%) ggc
 template instantiation  :   7.39 (100%) usr   0.28 (100%) sys   7.68 (98%)
wall 1422149 kB (100%) ggc
 expand                  :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     1 kB ( 0%) ggc
 integrated RA           :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
    24 kB ( 0%) ggc
 shorten branches        :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 symout                  :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 rest of compilation     :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall 
     2 kB ( 0%) ggc
 TOTAL                 :   7.41             0.28             7.83           
1423909 kB

real    0m8.237s
user    0m7.420s
sys     0m0.328s

But it's still orders of magnitude slower than clang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]