[sword-devel] SwordReader - Text render timings

David Trotz dtrotzjr at crosswire.org
Tue Jul 8 22:56:56 MST 2008

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.

        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

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

More information about the sword-devel mailing list