[CMake] performance of SET() vs. LIST(SET ...) ... and one feature
request
Alexander Neundorf
a.neundorf-work at gmx.net
Sun May 14 09:14:31 EDT 2006
Hi,
for testing the performance of appending items to a list via SET(var
${var} item) vs. LIST(SET var item) I wrote two ruby scripts which
generate CMakeLists.txt which do nothing else than this.
They do:
-generate 100 variables
-call set(var ${var} newItem) and respectively list(set var newItem) 1000
times for each
Results on a AMD XP 2000+:
using set: 2 min 48 s
using list(set ...): 9 s
I.e. using list(SET ...) is much faster for appending items to a list
than using SET().
The two scripts for generating the CMakeLists.txt are attached.
(But unfortunately that's not the bottleneck for kdebase)
One here comes the feature request:
set(foo)
list(SET foo "firstItem")
fails:
~/src/tests/cmakespeed$ cmake .
CMake Error: Error in cmake code at
/home/alex/src/tests/cmakespeed/CMakeLists.txt:2:
LIST cannot find variable: foo
-- Configuring done
It would be nice if this would work, otherwise one again has to use
if (var)
list(SET ...)
else
set(var ...)
endif
everywhere.
Bye
Alex
--
GMX Produkte empfehlen und ganz einfach Geld verdienen!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gencmake-list.rb
Type: application/x-ruby
Size: 235 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060514/22443959/gencmake-list.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gencmake-set.rb
Type: application/x-ruby
Size: 239 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060514/22443959/gencmake-set.bin
More information about the CMake
mailing list