Parallel moc for Qt files

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Parallel moc for Qt files

Michael Jackson
I have a large list of files that need to have Qt's 'moc' run on them
(107 headers). I use all the normal CMake facilities for Qt based
projects. I noticed that the generation of the moc files are done
serially. Is there a flag or anything that I can use to run the
generation in Parallel? I ask because each file takes about 3 seconds to
run through moc. The code is heavily C++ templated which I think causes
'moc' to run more slowly. We have other places in the code where 'moc'
must run and it does each file in the "blink of an eye".

Just curious.

--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: [hidden email]
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parallel moc for Qt files

Cristian Adam
On Thu, Jul 6, 2017 at 10:00 PM, Michael Jackson <[hidden email]> wrote:
I have a large list of files that need to have Qt's 'moc' run on them (107 headers). I use all the normal CMake facilities for Qt based projects. I noticed that the generation of the moc files are done serially. Is there a flag or anything that I can use to run the generation in Parallel? I ask because each file takes about 3 seconds to run through moc. The code is heavily C++ templated which I think causes 'moc' to run more slowly. We have other places in the code where 'moc' must run and it does each file in the "blink of an eye".

Just curious.


Have you tried removing moc altogether using Verdigris? I'm curious how this would speed up your compilation time.

Cheers,
Cristian.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parallel moc for Qt files

CMake mailing list
In reply to this post by Michael Jackson
I don't know how to parallelize moc with CMake though I previously reduce moc time (sometimes it's very slow) :

- by replacing as much #include as possible by forward-declaration

- wrapping some #include around #ifndef Q_MOC_RUN ... #endif

2017-07-06 22:00 GMT+02:00 Michael Jackson <[hidden email]>:
I have a large list of files that need to have Qt's 'moc' run on them (107 headers). I use all the normal CMake facilities for Qt based projects. I noticed that the generation of the moc files are done serially. Is there a flag or anything that I can use to run the generation in Parallel? I ask because each file takes about 3 seconds to run through moc. The code is heavily C++ templated which I think causes 'moc' to run more slowly. We have other places in the code where 'moc' must run and it does each file in the "blink of an eye".

Just curious.

--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: [hidden email]
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake



--
Benjamin Ballet
Ingénieur R&D


  

19 rue Klock - 92110 Clichy - FRANCE
Standard : +33 1 44 69 37 37

www.activisu.com




   

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parallel moc for Qt files

Michael Jackson
In reply to this post by Cristian Adam
Looks like an interesting project. After reading  the blog and reading the GitHub issue pages there seem to be serious issues with MSVC still which is a blocker for us. I will keep an eye on it though. 

--
Michael A. Jackson

From: Cristian Adam <[hidden email]>
Sent: Thursday, July 6, 2017 6:11:50 PM
To: Michael Jackson
Cc: cmake
Subject: Re: [CMake] Parallel moc for Qt files
 
On Thu, Jul 6, 2017 at 10:00 PM, Michael Jackson <[hidden email]> wrote:
I have a large list of files that need to have Qt's 'moc' run on them (107 headers). I use all the normal CMake facilities for Qt based projects. I noticed that the generation of the moc files are done serially. Is there a flag or anything that I can use to run the generation in Parallel? I ask because each file takes about 3 seconds to run through moc. The code is heavily C++ templated which I think causes 'moc' to run more slowly. We have other places in the code where 'moc' must run and it does each file in the "blink of an eye".

Just curious.


Have you tried removing moc altogether using Verdigris? I'm curious how this would speed up your compilation time.

Cheers,
Cristian.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parallel moc for Qt files

Michael Jackson
In reply to this post by CMake mailing list
Thank you for the suggestions. 

It is almost like a Jom for moc needs to be written. 

-Mike Jackson

From: Benjamin Ballet <[hidden email]>
Sent: Friday, July 7, 2017 5:47:20 AM
To: Michael Jackson
Cc: cmake
Subject: Re: [CMake] Parallel moc for Qt files
 
I don't know how to parallelize moc with CMake though I previously reduce moc time (sometimes it's very slow) :

- by replacing as much #include as possible by forward-declaration

- wrapping some #include around #ifndef Q_MOC_RUN ... #endif

2017-07-06 22:00 GMT+02:00 Michael Jackson <[hidden email]>:
I have a large list of files that need to have Qt's 'moc' run on them (107 headers). I use all the normal CMake facilities for Qt based projects. I noticed that the generation of the moc files are done serially. Is there a flag or anything that I can use to run the generation in Parallel? I ask because each file takes about 3 seconds to run through moc. The code is heavily C++ templated which I think causes 'moc' to run more slowly. We have other places in the code where 'moc' must run and it does each file in the "blink of an eye".

Just curious.

--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: [hidden email]
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake



--
Benjamin Ballet
Ingénieur R&D


  

19 rue Klock - 92110 Clichy - FRANCE
Standard : +33 1 44 69 37 37

www.activisu.com




   

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Parallel moc for Qt files

Konstantin Tokarev
In reply to this post by Michael Jackson


06.07.2017, 23:00, "Michael Jackson" <[hidden email]>:
> I have a large list of files that need to have Qt's 'moc' run on them
> (107 headers). I use all the normal CMake facilities for Qt based
> projects. I noticed that the generation of the moc files are done
> serially. Is there a flag or anything that I can use to run the
> generation in Parallel? I ask because each file takes about 3 seconds to
> run through moc. The code is heavily C++ templated which I think causes
> 'moc' to run more slowly. We have other places in the code where 'moc'
> must run and it does each file in the "blink of an eye".

Replace use of AUTOMOC with macros like qt5_generate_moc. Each moc file
will be generated by a separate custom command.

For example, I wrote 3 macros that wrap qt5_generate_moc for more
convenience [1], example usage is at [2].

[1] https://github.com/annulen/webkit/blob/qtwebkit-stable/Source/cmake/OptionsQt.cmake#L63
[2] https://github.com/annulen/webkit/blob/qtwebkit-stable/Source/WebCore/PlatformQt.cmake#L165

>
> Just curious.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: [hidden email]
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

--
Regards,
Konstantin
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Loading...