[Qt-interest] Different speed for different-sized lists?

Konrad Rosenbaum konrad at silmor.de
Tue Nov 2 10:37:20 CET 2010


On Wednesday 03 November 2010 02:58:55 Anatoly Burakov wrote:
> Basically, i have a "binary format" files (serialized QLists of objects)
> which i use to move data back and forth between several apps, one of
> which uses SQLite as a database engine. I have noticed that when i do
> import of, say, 1000 objects, the speed is about 3-4 objects per second
> (due to complex nature of data added to the database). However, when the
> list is 140'000 objects, the importing speed "magically" goes up to
> 20-30 objects per second. The code always stays the same (basically, a
> for(;;) loop with i < qlist.count() as a condition, so nothing special),
> only the amounts of data are changing.

Something else is changing. While I'm convinced that Qt is "magically nice", 
there is no black magic in it. ;-)

Likely candidates: 
* you send a signal to a different thread to update a progress bar, but the 
frequency changes with the amount (if((count/max)%100 == 0)setProgress(...)).
* you change the frequency of commits to the database


	Konrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101102/f91718e0/attachment.bin 


More information about the Qt-interest-old mailing list