On 01/29/2014 09:22 AM, Brad King wrote:
> I explained here:
> 
>  http://www.cmake.org/pipermail/cmake-developers/2014-January/009487.html
> 
> how the '$' in a value changes some core logic from a short-circuit
> to a complex evaluation.  However, the question now is why does this
> one COMPILE_DEFINITIONS property value get evaluated so many times
> that it becomes so noticeable.
> 
> How many directories (add_subdirectory) and targets (add_library or
> add_executable) does the project have?

To follow up here, we managed to find the reason the '$' makes things
so slow.  It can actually happen with only a single evaluation.  The
problem is the value ends up being appended to a very large string
(a list of include directories) and then passed through a macro
argument.  Since macros re-parse their arguments the large string
goes through ExpandVariablesInString and is very slow now that the
'$' prevents use of the fast-path.

There is separate ongoing work to improve the ExpandVariablesInString
slow-path performance, but for now we managed to solve the problem
for this Qt4 case with a simple change:

 Qt4Macros: Make QT4_CREATE_MOC_COMMAND a function
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7beba986

-Brad

-- 

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/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to