ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #02326
Re: [Ubuntu-touch-coreapps] [RSS - Reader] Performance issue in QtQuick.LocalStorage 2.0
Hey,
Am 13.06.2013 05:34, schrieb Joey Chan:
>
> Hi Geeks,
>
> I'm a developer of RSS reader, I found a performance issue in qml
> database, which blocks the main thread for seconds.
>
> /*issue description:*/
> <code>
> dbResult = tx.executeSql('INSERT INTO article (title, link,
> description, pubdate, guid, feed_id) VALUES(?, ?, ?, ?, ?, ?)',
> [title , link, description, pubdate,
> guid, feed_id])
> </code>
> I use this code to insert a row of data into database, if just one row
> needed, ok with that; but if I need many rows of data to be insert,
> the database engine will execute this code many times and blocks the
> main thread for seconds.
I have had the same problem with my podcast client. I could reduce the
time the main thread gets blocked by putting all inserts into one
transaction. Now it is not noticeable any more, at least for my use case.
>
> */solution: /*
> 1. WorkScript. not support .import includes QtQuick.LocalStorage 2.0
> >_<
See https://bugreports.qt-project.org/browse/QTBUG-27454 It would be
great, if QML supported the asynchronous LocalStorage API, though.
> 2. binding or batch execute. In Qt C++, a list can be binded to a
> QSqlQuery, then only execute once to insert them into database, can
> anyone teach how to do that in qml?
> 3. U1DB. I haven't tried it, is it stable now?
Even if it was stable, would it be asynchronous?
>
>
> Thanks,
> Joey
>
>
References