[Development] Qt 5.2 header diff: QtCore

Thiago Macieira thiago.macieira at intel.com
Tue Nov 5 05:17:40 CET 2013


On segunda-feira, 4 de novembro de 2013 17:25:45, Thiago Macieira wrote:
> qmetatype.h:
> > +#include <vector>
> > +#include <list>
> > +#include <map>
> 
> Argh. Thanks for making the compilation that much slower. These three lines 
> probably impact Qt's compilation time in 20%, or more.

With those three lines, src/corelib compiles in:
1:19.084s (total run time 1:19.273s), 333.4% CPU usage
  → 79.273 * 3.334 = 264.296182 CPU seconds

Without them, it was
1:16.792s (total run time 1:16.974s), 341.8% CPU usage
  → 76.792 * 3.418 = 262.475056 CPU seconds

Investigation shows <vector> gets included from <random> (which also includes 
<string>), which is included by <algorithm>, which we include from qglobal.h. 
And we need <algorithm> for something as trivial as std::swap.

$ g++ -E -xc++ -std=c++11 -include algorithm /dev/null | wc -l
40627

For libc++:
$ g++ -E -xc++ -std=c++11 -I. algorithm | wc -l
16012

Stats for 100 compilations of #include <algorithm> from libstdc++:
         39.797359 task-clock                #    0.997 CPUs utilized            
       130,078,729 cycles                    #    3.269 GHz                      
       0.039922876 seconds time elapsed                                          

Same for libc++:
         22.196385 task-clock                #    0.995 CPUs utilized            
        71,897,742 cycles                    #    3.239 GHz                      
       0.022299146 seconds time elapsed                                          

libc++'s build is 79% slower.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131104/77c25225/attachment.sig>


More information about the Development mailing list