[sword-devel] Delays in rendering?

Troy A. Griffitts scribe at crosswire.org
Sun Feb 22 09:11:00 MST 2015


David,

That's all fine. The initialization hit I spoke about in my last email will happen in the first section of your code. After that, you second section can run as many times as you'd like and should be extremely fast. Where are you noticing the speed delay?

On February 22, 2015 8:39:28 AM MST, David Judah's Shadow Blue <yudahsshadow at gmx.com> wrote:
>Here’s the relevant bits of code,
>
>
>std::string text = "";
>sword::ListKey refRange;
>sword::SWMgr library (new sword::MarkupFilterMgr (sword::FMT_PLAIN));
>sword::SWModule *module;
>sword::VerseKey key;
> 
>module = library.getModule (this->version.c_str());
>if (!module) {
>    text = "-1";
>    return text;
>}
> 
>refRange = key.parseVerseList (reference.c_str(), key, true);
>for (refRange = sword::TOP; !refRange.popError(); refRange++) {
>    module->setKey (refRange);
>    text += module->getKeyText();
>    text += " ";
>    text += module->renderText();
>}
>return text;
>
>
>
>
>If it makes any difference, the only installed module is the ESV.
>
>
>
>
>Sent from Windows Mail
>
>
>
>
>
>From: Troy A. Griffitts
>Sent: ‎Sunday‎, ‎February‎ ‎22‎, ‎2015 ‎12‎:‎13‎ ‎AM
>To: SWORD Developers' Collaboration Forum
>
>
>
>
>Hey David,
>
>It's hard to say without knowing what calls you're making to the API,
>but yes, it's likely you're doing something not in the optimal way.  My
>first guess is that you are calling an external program repeated to get
>results.  SWORD has an initialization hit when it first is accessed--
>finding all modules, loading locales, etc.  Once initialized, calls
>should be very fast, but if you are launching an external program over
>and over, the engine is initializing on each call.  Maybe not what
>you're doing, but without more info, that's my best shot.
>Hope we can get you running fast.
>
>Troy
>
>
>
>
>On 02/21/2015 07:16 PM, David "Judah's Shadow" Blue wrote:
>
>
>So I'm working on a console based front-end, and I'm noticing some
>slowness in displaying a text. Possibly a second or less, but
>definitely noticeable. Is there something I may be doing wrong?
>-- 
>Sent from my Android device with K-9 Mail. Please excuse my brevity. 
>
>
>_______________________________________________
>sword-devel mailing list: sword-devel at crosswire.org
>http://www.crosswire.org/mailman/listinfo/sword-devel
>Instructions to unsubscribe/change your settings at above pagess is
>
>------------------------------------------------------------------------
>
>_______________________________________________
>sword-devel mailing list: sword-devel at crosswire.org
>http://www.crosswire.org/mailman/listinfo/sword-devel
>Instructions to unsubscribe/change your settings at above page

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20150222/935ad363/attachment.html>


More information about the sword-devel mailing list