<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I am wondering whether it is possible to optimize the performance for getting a module’s book list.</div><div class=""><br class=""></div><div class="">The function I am currently using looks like this:</div><div class=""><br class=""></div><div class=""><div style="color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><div style="line-height: 18px;" class=""><div class="">        <span style="color: #4ec9b0;" class="">vector</span><<span style="color: #4ec9b0;" class="">string</span>> <span style="color: #9cdcfe;" class="">bookList</span>;</div><div class="">        <span style="color: #4ec9b0;" class="">string</span> <span style="color: #9cdcfe;" class="">currentBookName</span> = <span style="color: #ce9178;" class="">""</span>;</div><div class="">        <span style="color: #4ec9b0;" class="">VerseKey</span> *<span style="color: #9cdcfe;" class="">vk</span> = (<span style="color: #4ec9b0;" class="">VerseKey</span> *)<span style="color: #9cdcfe;" class="">module</span>-><span style="color: #dcdcaa;" class="">getKey</span>();</div><br class=""><div class="">        <span style="color: #c586c0;" class="">for</span> ((*<span style="color: #9cdcfe;" class="">vk</span>) <span style="color: #dcdcaa;" class="">=</span> <span style="color: #569cd6;" class="">TOP</span>; !<span style="color: #9cdcfe;" class="">vk</span>-><span style="color: #dcdcaa;" class="">popError</span>(); <span style="color: #9cdcfe;" class="">vk</span>-><span style="color: #dcdcaa;" class="">setBook</span>(<span style="color: #9cdcfe;" class="">vk</span>-><span style="color: #dcdcaa;" class="">getBook</span>()+<span style="color: #b5cea8;" class="">1</span>)) {</div><div class="">            <span style="color: #c586c0;" class="">if</span> (<span style="color: #9cdcfe;" class="">module</span>-><span style="color: #dcdcaa;" class="">hasEntry</span>(<span style="color: #9cdcfe;" class="">vk</span>)) {</div><div class="">                <span style="color: #9cdcfe;" class="">currentBookName</span> <span style="color: #dcdcaa;" class="">=</span> <span style="color: #9cdcfe;" class="">vk</span>-><span style="color: #dcdcaa;" class="">getOSISBookName</span>();</div><div class="">                <span style="color: #9cdcfe;" class="">bookList</span>.<span style="color: #dcdcaa;" class="">push_back</span>(<span style="color: #9cdcfe;" class="">currentBookName</span>);</div><div class="">            }</div><div class="">        }</div></div></div></div><div class=""><br class=""></div><div class="">In my node-sword-interface JavaScript world the wrapped function returns in a time between 10-15ms depending on the module.</div><div class=""><br class=""></div><div class="">When calling this once for the currently used Bible module … that’s fine.</div><div class="">But I now have a use case where I need to retrieve the book lists of all installed modules at once. In Ezra Bible App, the user has a possibility to switch the Bible module for the currently opened text.</div><div class="">In the respective selection box I would like to disable all Bible modules that do not contain the currently opened book. This could be the case for NT only, OT only or other modules of that sort.</div><div class="">In order to implement this dynamic disabling/enabling logic I need the book lists of all available SWORD modules <u class="">at once</u>. And suddenly we are looking at 200+ ms for the above mentioned function executed for let’s say 15 modules.</div><div class=""><br class=""></div><div class="">I am testing on a Mac mini to get performance figures for a lower end machine …</div><div class=""><br class=""></div><div class="">Now, having said all that … is there a way of optimizing the performance of the function above? Or have I overlooked something and need to approach this use case differently?</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Tobias</div></body></html>