[sword-devel] Delays in rendering?
David Judah's Shadow Blue
yudahsshadow at gmx.com
Sun Feb 22 08:39:28 MST 2015
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20150222/55e59e2b/attachment-0001.html>
More information about the sword-devel
mailing list