Discussion:
[cmake-developers] [CMake] Performance profiling for CMake scripts?
Robert Dailey
2018-06-20 14:17:49 UTC
Permalink
I set my minimum required version to 3.6, which should enable those
policies by default (if they're truly in 3.1 as you indicated).

My CMake scripts do a lot of work to build a "tree" of properties
connecting targets, so that I can recurse the targets my system
generates to process things. CMake does not natively offer the ability
to recurse targets created AFAIK. I suspect a lot of this logic is
what is causing the slow down, but at this point I have no tooling to
help me prove that.

I have included the developer list, maybe the CMake developers have
some insight for me as this doesn't seem to be a common user issue
from what I can tell.

On Wed, Jun 20, 2018 at 7:39 AM, Robert Maynard
I am not aware of any built in functionality that can generate
performance numbers for a project.
Have you made sure that the performance/parsing policies are set to
NEW or your cmake_minimum_required is sufficiently high, those can
have a significant improvement on configuration time.
Polices ( both in CMake 3.1 )
- CMP0054 'if parsing'
- CMP0053 'simplified variable reference and escape parsing'
So I noticed over the years my CMake scripts take longer and longer to
configure/generate. Is there a mechanism to tell which parts of my
CMake scripts are slowest? I'd like to know how to optimize my CMake
scripts to reduce the time it takes to generate projects.
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
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
https://cmake.org/mailman/listinfo/cmake
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Isaiah Norton
2018-06-20 21:26:28 UTC
Permalink
I've used the following a few times recently to get a sense of hotspots:

https://gist.github.com/ihnorton/05f1dea38e596e75ba106855d490e66a
Post by Robert Dailey
I set my minimum required version to 3.6, which should enable those
policies by default (if they're truly in 3.1 as you indicated).
My CMake scripts do a lot of work to build a "tree" of properties
connecting targets, so that I can recurse the targets my system
generates to process things. CMake does not natively offer the ability
to recurse targets created AFAIK. I suspect a lot of this logic is
what is causing the slow down, but at this point I have no tooling to
help me prove that.
I have included the developer list, maybe the CMake developers have
some insight for me as this doesn't seem to be a common user issue
from what I can tell.
On Wed, Jun 20, 2018 at 7:39 AM, Robert Maynard
I am not aware of any built in functionality that can generate
performance numbers for a project.
Have you made sure that the performance/parsing policies are set to
NEW or your cmake_minimum_required is sufficiently high, those can
have a significant improvement on configuration time.
Polices ( both in CMake 3.1 )
- CMP0054 'if parsing'
- CMP0053 'simplified variable reference and escape parsing'
So I noticed over the years my CMake scripts take longer and longer to
configure/generate. Is there a mechanism to tell which parts of my
CMake scripts are slowest? I'd like to know how to optimize my CMake
scripts to reduce the time it takes to generate projects.
--
Powered by www.kitware.com
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For
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
https://cmake.org/mailman/listinfo/cmake
--
Powered by www.kitware.com
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
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
https://cmake.org/mailman/listinfo/cmake-developers
Loading...