[cmake-developers] profiling cmake

Brad King brad.king at kitware.com
Mon Oct 23 13:18:25 EDT 2006


Alexander Neundorf wrote:
> So, I'm not sure whether there is much room for improvements. Maybe some cache 
> for turning ${somevar} into a vector<string>, using maybe cmVariableWatcher 
> to check whether somevar has changed in the meantime. Caching maybe 10 
> variables would probably be enough, since variables often are used only in 
> one file and not in others.

We could take the Tcl approach and convert the internal representation
of variable values to an object instead of a string.  The object would
have a dual representation: string and vector.  There would be lazy
conversion between the two representations as needed.  Currently there
are many places with code like this:

std::vector<std::string> defList;
if(const char* def = this->Makefile->GetDefinition("BLAH"))
  {
  cmSystemTools::ExpandListArguments(def, defList).
  }

If this were converted to some kind of direct call to get a list value
for the variable we could then do something like the above.

These changes would be sweeping and time consuming to implement.  I
don't know when we'll ever have time to do them.

-Brad



More information about the cmake-developers mailing list