[cmake-developers] dependency scanning speed

Bill Hoffman bill.hoffman at kitware.com
Mon Sep 11 09:02:43 EDT 2006


At 05:46 PM 9/10/2006, Alexander Neundorf wrote:
>3) it uses std::string::resize(4*1024) to preallocate space for the strings,  
>and then assigns always c_str() instead of the std::string itself, since 
>assigning the std::string apparently throws away the preallocated memory so 
>that the memory has to be allocated again if the string grows (which it does 
>often when creating the key for the header location cache). This saves 
>another 4 seconds.

This one concerns me.   Is this always legal to do?

-Bill




More information about the cmake-developers mailing list