[CMake] cmLocalGenerator::GenerateInstallRules() needlessly slow?/missing optimization?
Andreas Mohr
andi at lisas.de
Wed Sep 7 05:12:55 EDT 2011
Hi,
just saw that the main cmake_install.cmake contains (at the end):
FILE(WRITE
"[${CMAKE_BINARY_DIR}]/${CMAKE_INSTALL_MANIFEST}"
"")
FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
FILE(APPEND
"[${CMAKE_BINARY_DIR}]/${CMAKE_INSTALL_MANIFEST}"
"${file}\n")
ENDFOREACH(file)
as generated by CMake git
Source/cmLocalGenerator.cxx/cmLocalGenerator::GenerateInstallRules()
Depending on actual implementation of CMake (whether it has some caching
logic or not), this might be woefully inefficient,
causing a possibly _filesystem-bound_ file append for each line.
Perhaps it would be much better (fast memory-bound operation)
to first compile a list variable with these re-formatted entries
and _then_ write out the final list in one go to the file?
(I've done such stuff elsewhere, output format is fine).
Of course one would not want to pile up an endless amount of
individually caching layers, but in this case it could make a difference...
Thanks,
Andreas Mohr
More information about the CMake
mailing list