← Back to team overview

ubuntu-touch-coreapps team mailing list archive

Re: [RSS - Reader] Performance issue in QtQuick.LocalStorage 2.0

 

Al 13/06/13 16:03, En/na mrqtros@xxxxxxxxx ha escrit:
> Michael, it seems like you kidding me. Or us. I am like C++ and from the
> first day of my work in RSS team I always speak about xml parsing in
> C++, models and so on. But answer always was "you must use qml where
> it's possible". And what now?! A lot of code already written with
> xmllistmodel and executeSql, even if that way was more complex then c++
> realization.
> 

Hi Roman,

As he's saying, Michael is just expressing his view and trying to help.

The principle for the core apps design is indeed to stay declarative as
much as possible and where it makes sense, but the guide also mentions
that there are some cases where it's not possible and a C++ plugin might
be needed.

https://wiki.ubuntu.com/Touch/CoreApps/DevelopmentGuide#Ubuntu_Phone_Core_App_Development_Principles

I think for any case where there's doubt, we've got this list as a good
vehicle to have a technical discussion and come up with a solution.

Cheers,
David.

> 
> 13.06.13 15:39 Michael Zanetti написал(а):
> 
> Hi,
> 
> At the risk that some people don't like to hear this, I would highly
> recommend
> to write the actual feed fetching and database storing part in C++/Qt
> and only
> expose a well defined model containing the RSS feeds to QML. Maybe one
> model
> per feed source or something like that.
> 
> Writing all that SQL query stuff in javascript will end up being more
> complex
> and fail prone than writing a simple QML plugin in Qt.
> 
> Br,
> Michael
> 
> On Thursday 13 June 2013 11:34:59 Joey Chan wrote:
>> 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.
>>
>> *solution: *
>> 1. WorkScript. not support .import includes QtQuick.LocalStorage 2.0 >_<
>> 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?
>>
>>
>> Thanks,
>> Joey
> 
> -- 
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> <mailto:ubuntu-phone@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help : https://launchpad.net/~ubuntu-phone
> 
> 
> 
> 



References