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

Felipe Crochik qt-project at b2-4ac.com
Tue Oct 29 19:13:05 CET 2013


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!!!!

Attached you will find a zip file with a set of qml files (didn't attach
the full project to avoid bloating the message, but a simple project
created using the wizard for "Qt Quick 2 Application (using built-in
types)" will do - just copy these files to the qml folder). Running this
test on my phone will take almost 3 seconds. Later on I can test the same
code in two more devices and benchmark, but if you are anybody give it a
try let me know.

Thanks,
Felipe



On Tue, Oct 29, 2013 at 11:32 AM, Simon Hausmann
<simon.hausmann at digia.com>wrote:

> On Tuesday 29. October 2013 11.12.07 Felipe Crochik wrote:
> > Hi Simon,
> > Thank you for your reply, here are the answers to your questions:
> > 1. I am using
> >
> qt-windows-opensource-5.2.0-beta1-android-x86-win32-offline_2013-10-22_08-54
> > -34-108.exe 2. using arm5 (don't think the device I am testing, lg
> optimus g
> > pro, supports arm7va)
>
> Ok. That's good.
>
> As far as Wikipedia tells, your processor should support ARMv7. Can you try
> doing an ARMv7 build and let us know if this makes any difference to your
> test
> case or not?
>
> (This helps isolating things down between the JIT or the Interpreter, the
> former is only used with ARMv7)
>
> > 3. not importing any large javascript. I import a 65 lines long
> javascript
> > in one component and other than the typical handling of events I have 2
> > other functions defined inside a component that add up to 100lines of
> > javascript
>
> Ok!
>
> > 4. I think it has to be the component instantiation. I have a very simple
> > qml with a mousearea and a loader. the mousearea onclick sets the source
> of
> > the loader to what used to be my main.qml file. I am measuring the time
> > between just before setting the source of the loader and on executing the
> > Component.OnCompleted in the main.qml top component. No other component
> has
> > a OnCompleted handler so if any code is ran before the oncompleted is on
> > the bindings.
> >
> > The code is really simple. I will break it apart and see if I can isolate
> > the cause.
>
> Would be great if you can somehow create a simple test-case for us. I'm
> pretty
> sure that we can fix this :)
>
>
> Simon
>
> > On Tue, Oct 29, 2013 at 10:40 AM, Simon Hausmann
> >
> > <simon.hausmann at digia.com>wrote:
> > > On Tuesday 29. October 2013 10.31.16 Felipe Crochik wrote:
> > > > summary: some very simple "qml" code now is taking 4 seconds to
> "parse"
> > >
> > > and
> > >
> > > > get to the "component.onCompleted" on android. It is instantaneous
> using
> > > > qml 1.0/old necessitas. What is the best way to profile and found
> why?
> > > > Anybody seeing a much longer "parsing time"? can it be related to the
> > > > replacement of V8?
> > >
> > > Quite likely, and also quite likely to be a bug :)
> > >
> > > Can you elaborate a bit on some details? I'd be curious about the
> > > following:
> > >
> > > * From when is your build of Qt?
> > > * Is this a build for ARMv7 or older?
> > > * Are you importing bigger pieces of JavaScript using import? (nothing
> bad
> > > about it, merely curious)
> > > * Can you help us identify if is it the type instantiation that is
> slow or
> > > the
> > > execution of Component.onCompleted itself? I.e. if you add a
> console.log
> > > at
> > > the beginning of Component.onCompleted, does it take 4s until you see
> that
> > > message or does it take 4s _after_ seeing it?
> > >
> > >
> > >
> > > Simon
> > >
> > > > longer version:
> > > > I have this very simple game (
> > > > https://play.google.com/store/apps/details?id=com.crochik.lockcode)
> > >
> > > that I
> > >
> > > > had created using qml 1.0 and deployed to android using one of the
> alpha
> > > > releases of necessitas/qml 1.0. The game is just qml and javascript,
> > >
> > > using
> > >
> > > > only basic qml components.
> > > >
> > > > I just created a new "qt quick 2.0" project, copied the qml files to
> the
> > > > project and changed the "headers"  to use qt quick 2.0 (instead of 1)
> > > > and
> > > > now it takes 4 seconds to "parse the qml" and get to the top level
> > > > component.oncompleted. I am using a loader to "measure" the time
> between
> > > > setting the loader source and getting to the "oncompleted" on the
> > > > "loaded
> > > > top level component"
> > > >
> > > > Thanks,
> > > > Felipe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131029/66158dc9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.zip
Type: application/zip
Size: 1769 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131029/66158dc9/attachment.zip>


More information about the Development mailing list