[mythtv] 0.28 MythVideo: slow loading
Angela
angela.schmid at wolke7.net
Sun Jan 31 16:54:28 UTC 2016
> However, more importantly,
> doing return _a < _b (as we do want to sort the entries obviously), leads
to
> almost no noticeable difference.
> Like timing it about a dozen time where I used to see a time of 10-11, i
see a
> time of like 9.6-10.8
>
> So nothing of significance...
>
> I don't believe it's a natural sort as such, the sort itself takes a bit
of time, but
> again, nothing worth improving.
I profiled with valgrind. The culprit is
const int cmp = QStringRef::localeAwareCompare(subA, subB);
Master, QT5.2.1, it takes 95% compared to the total time of his parent
naturalCompare
0.27, QT4, it takes 0.5%
I will use the following source for the moment and see with futher QT5
versions if it gets better.
diff --git a/mythtv/libs/libmythbase/mythmiscutil.cpp
b/mythtv/libs/libmythbase/mythmiscutil.cpp
index b15322a..90ae62d 100644
--- a/mythtv/libs/libmythbase/mythmiscutil.cpp
+++ b/mythtv/libs/libmythbase/mythmiscutil.cpp
@@ -1049,6 +1049,9 @@ int naturalCompare(const QString &_a, const QString
&_b, Qt::CaseSensitivity cas
b = _b.toLower();
}
+return a < b ? -1 : 1;
+
const QChar* currA = a.unicode(); // iterator over a
const QChar* currB = b.unicode(); // iterator over b
Angela
More information about the mythtv-dev
mailing list