[mythtv] 0.28 MythVideo: slow loading

Jean-Yves Avenard jyavenard at gmail.com
Sun Jan 31 22:13:52 UTC 2016


On 1 February 2016 at 03:54, Angela <angela.schmid at wolke7.net> wrote:

> 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

Thank you heaps for doing that...

I wouldn't have found it...

you can simply do     return QString::compare(_a, _b, caseSensitivity);
right at the top.

But I'll write a work around for Qt < 5.3 shortly.


More information about the mythtv-dev mailing list