[sword-devel] SwordReader - Text render timings
Troy A. Griffitts
scribe at crosswire.org
Wed Jul 9 04:39:24 MST 2008
Yeah, somewhere before:
s += (TCHAR *)m_modCurText->RenderText();
add the line:
m_modCurText->processEntryAttributes(false);
Your call to:
SWBuf preverseHeading = m_modCurText->getEntryAttributes()...;
is off anyway, as entryAttributes aren't populated until RenderText is
called. So this probably explains why your headings are 1 verse off.
-Troy.
David Trotz wrote:
> I took some time tonight looking more into where all the time is spent
> loading a chapter of text. I put some microsecond timers around the more
> significant calls in my LoadText call and this is what I found when
> loading KJV version of Psalm 119 w/ all options off.
>
> <snip>
> m_modCurText->SetKey(keyCur);
> 0.009748 s
> sprintf(strNum, i"386483203", pvHeading++);
> 0.002622 s
> SWBuf preverseHeading = m_modCurText->getEntryAttributes()...
> 0.134881 s
> if (preverseHeading.length()) {...
> 0.000000 s
> s = GetVerseHeader(keyCur);...
> 0.062169 s
> s += (TCHAR *)m_modCurText->RenderText();...
> 4.705670 s
> s += ;
> 0.002992 s
> if (s.length() > 0) {...
> 0.094492 s
> if (keyCur.Verse() == GetMaxVerses())...
> 0.000000 s
> Total Time ...
> 5.036635 s
> </snip>
>
> Out of 5 seconds we spend ~90% of it in RenderText. Just to be sure my
> copy constructor wasn't the culprit, I took the 's += (TCHAR *)' part
> off and tried again. It only shaved a bout 40 ms off the top.
>
> thoughts, ideas, workarounds?
> --
> In Christ,
> David Trotz
>
> _______________________________________________
> 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
More information about the sword-devel
mailing list