[sword-devel] engine profiling

David Trotz dtrotzjr at crosswire.org
Tue Jul 22 21:03:31 MST 2008


Troy,
Good news, after you went to sleep, I tried fully optimized code 
(preferring speed over size) and I got the results we expected.

For reference these are my old timings:
***********************************************
OLD

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>

***********************************************
NEW

KJV version of Psalm 119 w/ all options off.

<snip>

m_modCurText->SetKey(keyCur);
        0.008105
sprintf(strNum, i"1472589783", pvHeading++);
        0.002758
SWBuf preverseHeading = m_modCurText->getEntryAttributes()...
        0.021899
if (preverseHeading.length()) {...
        0.000000
s = GetVerseHeader(keyCur);...
        0.024966
s += (TCHAR *)m_modCurText->RenderText();...
        1.635440
s += ;
        0.001546
if (s.length() > 0) {...
        0.051099
if (keyCur.Verse() == GetMaxVerses())...
        0.000000
Total Time ...
        1.765442

</snip>

***********************************************

Much better results and more manageable. Thanks for looking more into 
this. I really appreciate it.

In Christ,
David Trotz




More information about the sword-devel mailing list