<div dir="ltr"><div>Thanks for the Answer!</div>I actually do not want to alter CMake in any way (and I don't want to create a custom cmake executable) if possible.  load_command would have been perfekt.<div><br></div><div>I am losing alot of performance in my map_set() map_get() etc functions which translate down to set_property(GLOBAL...) and get_property(GLOBAL)  </div><div>I am further losing especially much performance when using my eval() function which dynamically runs cmake code and on which alot of my lib is based as it is the basis for dynamic method calls, objects&inheritance, callbacks, events etc.</div><div><br></div><div>I have already condensed down my functions to work with the minimal cmake script statements possible the only way to further improve is by creating a C/C++ cmake command.  The problem is: I have so many function calls that the time it takes is not negligable any more</div><div><br></div><div>I guess the only viable and platform independent solution is - as you wrote - to create a cmake with some custom command which replaces the users current cmake.  </div><div><br></div><div><br></div><div>Performance Comparison (cmake code):</div><div><br></div><div><div>  timer_start(t1)</div><div>  foreach(i RANGE 0 10000)</div><div>    map_set(asd "${i}" "${i}")</div><div>  endforeach()</div><div>  timer_print_elapsed(t1)</div><div><br></div><div>  ## almost equivalent code</div><div>  timer_start(t2)</div><div>  foreach(i RANGE 0 10000)</div><div>    set_property(GLOBAL PROPERTY "asd.${i}" ${I})</div><div><div>    set_property(GLOBAL APPEND PROPERTY "asd" ${i})</div></div><div>  endforeach()</div><div>  timer_print_elapsed(t2)</div><div><br></div><div><br></div><div>  timer_start(t3)</div><div>  foreach(i RANGE 0 10000)</div><div>    eval("")</div><div>  endforeach()</div><div>  timer_print_elapsed(t3)</div></div><div><br></div><div><br></div><div>output:</div><div><br></div><div><div>t1: 2038 ms</div><div>t2: 204 ms</div><div>t3: 9424 ms</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 25, 2015 at 1:21 PM, David Cole <span dir="ltr"><<a href="mailto:DLRdave@aol.com" target="_blank">DLRdave@aol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You could patch the executable to make cmLoadCommandCommand return<br>
true from IsScriptable... but if you're going to the trouble of<br>
patching CMake anyhow, why not simply build your loadable command<br>
directly into CMake...?<br>
<br>
The other thing might be to mention specifically what the performance<br>
problem is on the mailing list here to see if anybody has any ideas<br>
how we could make things faster..... And totally preclude your need to<br>
load an additional command in the first place.<br>
<br>
Or profile it and submit a patch to improve the performance in this situation.<br>
<br>
<br>
HTH,<br>
David C.<br>
<div><div class="h5"><br>
<br>
<br>
On Wed, Feb 25, 2015 at 5:46 AM, Tobias Becker <<a href="mailto:becker.tobi@gmail.com">becker.tobi@gmail.com</a>> wrote:<br>
> Hi<br>
><br>
> I've been working on an open source project which provides alot of extra<br>
> cmake (in pure cmake) <a href="https://github.com/toeb/cmakepp" target="_blank">https://github.com/toeb/cmakepp</a>.  I am however hitting<br>
> a performance bottleneck and want to get around that by using load_command<br>
> (I know it is discouraged) however I have the problem that it is not<br>
> scriptable and all of my functions need to be available in script mode.<br>
><br>
> Is there a way to load compiled commands into cmake after it was compiled?<br>
> (I have even thinking about patching the executable to make<br>
> cmLoadCommandCommand return true in its IsScriptable method)<br>
><br>
> But there should be a simple way?<br>
><br>
><br>
> Cheers,<br>
><br>
> Tobias<br>
><br>
</div></div>> --<br>
><br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Please keep messages on-topic and check the CMake FAQ at:<br>
> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
><br>
> Kitware offers various services to support the CMake community. For more<br>
> information on each offering, please visit:<br>
><br>
> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>