[Qt-qml] Any tips or tricks to help with long app startup times?

Todd Rose teeceeare97 at gmail.com
Fri Sep 30 20:20:30 CEST 2011


Thanks to everyone for the suggestions.   I'm making progress and
chipping away at the startup slowness.  The main problem is still
image loading.  It seems like there's not much that you can do to
workaround the fact that QPixmaps are tied to the GUI thread.   Our
image providers cache QImage and are multi-threaded, but in the end
there's still the QImage -> QPixmap conversion that has to happen when
painting.

One simple thing that I did that seems to help with perceived startup
slowness is to add a simple splash screen in main() before the
QDeclarativeView is initialized.  I guess you could maybe do a splash
image in QML as well, but I wasn't able to have much success there -
init'ing everything on GUI thread means splash page never really gets
to paint.   Initializing via a worker thread would be the way to go,
but we're talking Symbian here, and there's just too much that can go
wrong for me there.

On Thu, Sep 29, 2011 at 4:18 PM,  <rajesh.lal at nokia.com> wrote:
> Use loader ?
>
>
>
> http://www.slideshare.net/rajeshlal/qml-performance-tips-meego-conference-san-francisco-hyatt-regency-may-23252011
>
>
>
> From: qt-qml-bounces+rajesh.lal=nokia.com at qt.nokia.com
> [mailto:qt-qml-bounces+rajesh.lal=nokia.com at qt.nokia.com] On Behalf Of ext
> Artem Marchenko
> Sent: Thursday, September 29, 2011 12:46 PM
> To: Pelle Johnsen
> Cc: Qt-qml at qt.nokia.com
> Subject: Re: [Qt-qml] Any tips or tricks to help with long app startup
> times?
>
>
>
> Hello guys
>
>
>
> In my old mobile gaming programming times I was solving similar issues by
> loading single very big image and making small images to just refer to
> different parts of that big image. That's quite standard technique for 2D
> gaming - loading many sprites takes time on all systems.
>
>
>
> That is probably impossible if you go for pure QML, but if you are ready to
> experiment with QmlCanvas and/or with trying to implement your own image
> providers that would provide sprites from the single huge image, that could
> help. Guarantees quite some headache though.
>
>
>
> BR,
>
> Artem.
>
>
>
> On Sep 29, 2011, at 10:39 PM, Pelle Johnsen wrote:
>
> Hi again,
>
>
>
> You are right in that you don't need to specify async for network images
> (sorry for not realizing that). In our tests we however found that it was
> not loading the image data itself that was taking time, but creating the
> QPixmaps, and because of QPixmap's limitation that can only be done in the
> main ui thread - which then blocks the whole ui :( I don't know if there has
> been improvements to this in 4.8, but it is a fundamental issue that QML
> Image items use QPixmap, and these can ONLY be created in the main ui
> thread.
>
>
>
> I would guess QtQuick 2.0 would remedy this by not using QPixmaps, but
> OpenGL textures instead for QML Image.
>
>
>
>  -Pelle
>
> On Thu, Sep 29, 2011 at 9:09 PM, Artem Marchenko <artem.marchenko at gmail.com>
> wrote:
>
> Hmm, Pelle
>
>
>
> Documentation tells that asynchronous works only with local filesystem, I am
> not sure if resource file counts as local filesystem
>http://doc.qt.nokia.com/4.7-snapshot/qml-image.html#asynchronous-prop
>
>
>
> It probably won't help, but if I was desperate I would have tried deploying
> images to file system and not to resource file and then tried asynchronous
> property.
>
>
>
> Best regards,
>
> Artem.
>
>
>
>
>
>
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>
>


More information about the Qt-qml mailing list