<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 Troy,<div class=""><br class=""></div><div class="">I am compiling SWORD using CMake and I am setting <span style="color: rgb(54, 54, 54); font-family: Menlo, Monaco, "Courier New", monospace; white-space: pre; background-color: rgb(255, 255, 255);" class="">CMAKE_BUILD_TYPE </span><span style="white-space: pre; background-color: rgb(255, 255, 255);" class="">to</span><span style="color: rgb(54, 54, 54); white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span style="white-space: pre; background-color: rgb(255, 255, 255);" class="">"Release", which should automatically result in compiler optimization (-O3) being active (right, Greg?).</span></div><div class=""><br class=""></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class="">The numbers below are when using the NASB, but I guess that’s similar in markup compared to the KJV.</span></span></div><div class=""><br class=""></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class="">From a pure user perspective I am thinking … getting an outline (the list of section headers from one particular book) shouldn’t take 700ms … </span></span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class="">But I realize that we are essentially dealing with the complexity of a full text</span> </span><span style="caret-color: rgb(162, 86, 55); white-space: pre; background-color: rgb(255, 255, 255);" class="">search. If you could have a look with your profiler I’d be glad!</span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class=""><br class=""></span></span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class="">I am currently implementing chapter-based loading in Ezra. So far I have always loaded books fully, but this tends to be too much data and too slow for lower performance devices (tablets!), especially with large books like Psalms or Isaiah.</span></span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class="">To enhance the navigation experience I would like to still load the full list of section headers even though only one chapter is loaded at a time.</span></span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre;" class="">But if loading the section header list takes almost as much time as loading the whole book then I am not winning much here ...</span></span></div><div class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre; background-color: rgb(255, 255, 255);" class="">Best regards,</span></div><div class=""><span style="caret-color: rgb(162, 86, 55); white-space: pre; background-color: rgb(255, 255, 255);" class="">Tobias</span></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 23.05.2021 um 21:08 schrieb Troy A. Griffitts <<a href="mailto:scribe@crosswire.org" class="">scribe@crosswire.org</a>>:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class="">
<div class=""><p class="">Hi Tobias,</p><p class="">What's happening when you do an EntryAttributes search, is that
each entry is pulled from storage and all tags processed to build
the attributes map for that entry, then a pattern match is
attempted against the attributes which match your attribute key
map. Loading up each entry and processing all tags on a module
which is richly marked up like the KJV module, for example, can
take a bit of time. Compiling SWORD with optimization can greatly
reduce the time. I can also make a profiling pass on that action
and see if there is anything I can clean up, but generally, for
unindexed searches, we try to hit <1sec on desktops and
<3sec on handhelds for a richly marked up Bible like the KJV.</p><p class="">Troy<br class="">
</p>
<div class="moz-cite-prefix">On 5/23/21 5:40 PM, Tobias Klein wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:e049e582-b0b9-f42e-0fdb-81b34a7d099f@tklein.info" class="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" class=""><p class="">When I extract the section headers using the search function
this takes ~700ms for Psalms (on my Core i7, measured on
JavaScript side). I suppose it is much slower on a tablet or
phone.</p><p class="">Is there any way to speed up this operation in the SWORD
engine?<br class="">
<br class="">
Best regards,<br class="">
Tobias<br class="">
</p>
<div class="moz-cite-prefix">On 5/23/21 2:20 PM, Tobias Klein
wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:693db61b-a949-f607-16b4-ba3e81cf04d4@tklein.info" class="">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" class=""><p class="">Thanks, Troy.</p><p class="">The issue was that I previously hadn't used this:</p>
<pre style="font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; overflow-wrap: break-word; white-space: pre-wrap;" class="">mgr.setGlobalOption("Headings", "On");</pre>
<div class="moz-cite-prefix">My new helper function now works
after using that call initially.<br class="">
</div>
<div class="moz-cite-prefix"><br class="">
Best regards,<br class="">
Tobias<br class="">
</div>
<div class="moz-cite-prefix"><br class="">
</div>
<div class="moz-cite-prefix">On 5/22/21 11:09 PM, Troy A.
Griffitts wrote:<br class="">
</div>
<blockquote type="cite" cite="mid:E1B40477-C913-410B-A1DE-F92E34D5F305@crosswire.org" class="">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8" class="">
Hi Tobias. Have a look at sword/examples/cmdline/search.cpp. I
believe it takes an optional range parameter.<br class="">
<br class="">
<br class="">
<br class="">
<div class="gmail_quote">On May 22, 2021 7:49:48 PM GMT+02:00,
Tobias Klein <a class="moz-txt-link-rfc2396E" href="mailto:contact@tklein.info" moz-do-not-send="true"><contact@tklein.info></a>
wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<pre class="k9mail">Hi Troy,
I can't seem to get the scope parameter of the search function right ...
I either get crashes or no results.
How do I have to initialize the scope parameter for the module search so
that I get the headings for one particular Bible book as search results?
Best regards,
Tobias
On 4/12/21 9:07 PM, Troy A. Griffitts wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> Sure Tobias,
module->getEntryAttributes() will allow you to pull the headings from a
verse, and
an Entry Attributes search for '/Heading' will give you only the verses
with Heading entries attributes.
I've thrown together a quick example here, which you can use with
something like:
./showHeadings NASB Matt-John
which will give you the headings from the Gospels.
<a href="https://crosswire.org/svn/sword/trunk/examples/tasks/findHeadings.cpp" moz-do-not-send="true" class="">https://crosswire.org/svn/sword/trunk/examples/tasks/findHeadings.cpp</a>
Creating this example, I found I needed to fix a bug in the engine. The
engine Entry Attributes search lets you search for values in the entry
attributes (e.g., a Strong's number 1234). In your use case, when
searching, you don't care about the value; you only care about
presence. This wasn't working, but simple presence can now be searched
for with my latest commit.
Hope this helps,
Troy
On 4/12/21 9:31 AM, Tobias Klein wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Hi,
I have been getting a request from a user to render section headings independently of the currently opened bible translation module.
So for example when opening the KJV still using the section/chapter headers of the NASB.
This would be useful in those cases when the respective bible translation module does not come with section/chapter headers, but another one does.
A requirement would be to efficiently extract section/chapter headers from a module using the SWORD API. As of now I only see that you can iterate over the verses of a book and individually scan each verse for the headers. Is there a more efficient way of doing that?
Another use case could be to render a book outline. This is what I am already doing now in Ezra, but in a way that is not so clean (I am traversing the DOM looking for all section header elements of the current book).
Best regards,
Tobias<hr class=""> sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org" moz-do-not-send="true">sword-devel@crosswire.org</a>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" moz-do-not-send="true" class="">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</blockquote><hr class="">sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org" moz-do-not-send="true">sword-devel@crosswire.org</a>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" moz-do-not-send="true" class="">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page
</blockquote><hr class="">sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org" moz-do-not-send="true">sword-devel@crosswire.org</a>
<a href="http://crosswire.org/mailman/listinfo/sword-devel" moz-do-not-send="true" class="">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
</div>
<br class="">
-- <br class="">
Sent from my Android device with K-9 Mail. Please excuse my
brevity. </blockquote>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org" moz-do-not-send="true">sword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel" moz-do-not-send="true">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
<br class="">
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
</div>
_______________________________________________<br class="">sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" class="">sword-devel@crosswire.org</a><br class=""><a href="http://crosswire.org/mailman/listinfo/sword-devel" class="">http://crosswire.org/mailman/listinfo/sword-devel</a><br class="">Instructions to unsubscribe/change your settings at above page</div></blockquote></div><br class=""></div></body></html>