[Development] Qt 5.2 Beta - is it really much slower to parse qml/javascript on android?

Felipe Crochik qt-project at b2-4ac.com
Wed Oct 30 14:10:21 CET 2013


OK. You just nailed it! After moving the files into a resource file the
"startup" went from a little over 4 seconds to less than half second.  Just
for context: my application has 18qml files, 2 small javascript files and
20 or so images and not all of them are loaded on startup!

A little surprising and a lot disappointing is that my main phone (android
4.1.2) seems to make the problem even worst. I tried on a Nexus7 (android
4.3) and a 2+year old HTC inspire (android 4.2.2) and both are much quicker
when not using the resource file (there is the possibility that the actual
android has been improved since both of these devices have newer versions
of it). They are still much slower than using the resource file.

On hindsight:
1. my original qml 1.0 version uses the resource file - didn't occur to me
that this could make such a difference!
2. The Qt 5.1 document on android suggests using the resource (
http://qt-project.org/doc/qt-5.1/qtdoc/android-support.html) and even
states "The most convenient option is to bundle the resources into a qrc
file, which gets built into the application binary. This approach reduces
the porting effort considerably and provides *faster access to the resources
*. It is also a cross-platform approach, which makes porting to other
platforms easier.". For the 5.2 version I think we should make it stand out
with some "big bold red blinking letters (TM)" and also change the wizard
template to use resources by default for android. It can be the difference
between a "useless" application that takes forever to start and "Qt/qml is
really great even on  android"!

Thanks all!
Felipe


On Wed, Oct 30, 2013 at 4:09 AM, BogDan <bog_dan_ro at yahoo.com> wrote:

> Hi,
>
> Android's assets are indeed slower (~2X) than Qt's resource system,
> but not that slow ! :)
>
> If I recall correctly in the beginning of this thread Kai said that using
> Necessitas SDK it was ok, and I don't think he is using another technique
>  to store the qml files than he is using for Necessitas. Also the assets
> implementation should be pretty much the same ... unless me (or someone
> else)
> screw the implementation in Qt 5.2 :).
>
> Cheers,
> BogDan.
>
>
>
> >
> > I think i know whats the issue if its still not fixed.
> >
> > My guess is that you don't use the resource system of Qt but the android
> > application assets to store your components, the last time i had issues
> > with this all the time was lost in the horrible slow fileengine for
> assets on
> > android. It looked to me it was reopening the assets all the time which
> seems
> > expensive.
> >
> > I haven't tried it since 5.1 but if it is not fixed its very likely the
> > cause
> > of your problem.
> >
> > Björn
> > Am Mittwoch, 30. Oktober 2013, 07:07:41 schrieb Koehne Kai:
> >
> >>  > -----Original Message-----
> >>  > From: development-bounces+kai.koehne=digia.com at qt-project.org
> >>  > [mailto:development-bounces+kai.koehne=digia.com at qt-project.org] On
> >>  > Behalf Of Felipe Crochik
> >>  > Sent: Tuesday, October 29, 2013 7:13 PM
> >>  > To: Hausmann Simon
> >>  > Cc: development at qt-project.org
> >>  > Subject: Re: [Development] Qt 5.2 Beta - is it really much slower to
> > parse
> >>  > qml/javascript on android?
> >>  >
> >>  > Simon,
> >>  > Quick update:
> >>  > I tried arm7va and got almost the same results (a very small
> > improvement
> >>  > but still over 3seconds).
> >>  >
> >>  > It doesn't seem to be related at all to my code. It seems that it
> > is
> >>  > adding some "fixed amount" of time for each component than
> > has to parse.
> >>  > It doesn't look like is related to what they are or how complex.
> > For
> >>  > instance in one of my tests I had a component that was a Rectangle
> > with a
> >>  > Text inside, by just refactoring the Text to become another component
> > I
> >>  > went from 1.2s load time to almost 2. The example does not include
> any
> >>  > javascript!!!!
> >>
> >>  Have you tried running the app with the QML Profiler attached?
> >>
> >>  See
> >>
> >>
> >
> http://qt-project.org/doc/qtcreator-2.8/creator-qml-performance-monitor.html
> >>
> >>  Regards
> >>
> >>  Kai
> >>
> >>  _______________________________________________
> >>  Development mailing list
> >>  Development at qt-project.org
> >>  http://lists.qt-project.org/mailman/listinfo/development
> >
> > --
> > Björn Breitmeyer | bjoern.breitmeyer at kdab.com | Software Engineer
> > KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
> > Germany: +49-30-521325470, Sweden (HQ): +46-563-540090
> > KDAB - Qt Experts - Platform-independent software solutions
> >
> > _______________________________________________
> > Development mailing list
> > Development at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/development
> >
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131030/70621634/attachment.html>


More information about the Development mailing list