On 01/16/2014 02:18 PM, Clinton Stimpson wrote:
> On Thursday, January 16, 2014 11:49:58 AM Ben Boeckel wrote:
>> On Thu, Jan 16, 2014 at 08:41:58 -0700, Clinton Stimpson wrote:
>>> I'm surprised how this small change added a 20% slowdown.
>>> -set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG
>>> QT_DEBUG)
>>> +set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<NOT:
>>> $<CONFIG:Debug>>:QT_NO_DEBUG>)
[snip]
> However, the profile of my test case showed that the time increase is in the 
> parser (yylex).  Perhaps someone else can look further into this.

The addition of '$' to the value to causes the fast-path in
cmMakefile::ExpandVariablesInString to be skipped:

 
http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmMakefile.cxx;hb=v2.8.12.1#l2535
 if ( source.empty() || source.find_first_of("$@\\") == source.npos)
   {
   return source.c_str();
   }

Instead full expansion using cmCommandArgumentParserHelper occurs
which is much slower.  The latter code path is ripe for optimization
by re-implementing it without flex/bison generators.  Unfortunately
the current logic has so many idiosyncrasies that a re-implementation
will almost certainly introduce subtle behavior changes.

-Brad

-- 

Powered by www.kitware.com

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

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

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

Reply via email to