Andre Poenitz wrote:
Remove width cache for Qt 4 frontend.
Total time for loading UserGuide + 250 x page down is
4.42s with map based font cache
3.46s with vector based font cache
3.44s without fontcache
3.18s without fontcache and inlined QLFontInfo::metrics
Patch for the latter attached.
Note also that ucs4_to_qstring is currently more expensive than
rowBreakPoint() [which was actually the place I intended to work
on...]:
ucs4_to_qstring is pretty simple:
QString const ucs4_to_qstring(char_type const * str, size_t ls)
{
QString s;
for (size_t i = 0; i < ls; ++i)
s.append(ucs4_to_qchar(str[i]));
return s;
}
So, maybe with a static QString we could speed up the thing. But I
thought that QString were implicitely shared...
And ucs4_to_qchar is a simple cast solution:
QChar const ucs4_to_qchar(char_type const & ucs4)
{
return QChar(static_cast<unsigned short>(ucs4));
}
We could also use a static QChar here, dunno...
I will apply the patch tomorrow evening unless I get objections or
somebody else is faster.
Note that I already made some changes to Fontloader so you'll need to
adapt your patch. FYI the reason why the cache was re-enabled was
because of really bad performance under MacOSX.
But I am not formally opposed to the patch as I think that this is a bad
solution. We'll try to investigate other solution for MacOSX performance
problems. It could well be that the problem will disappear with Qt4.2,
dunno.
Abdel.