[Qt-interest] Different speed for different-sized lists?
Anatoly Burakov
burakov.anatoly at gmail.com
Wed Nov 3 02:58:55 CET 2010
Hi all.
I have noticed this strange behaviour a while ago and still can't figure
out why is this happening.
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.
The database code is also nothing special - a QList of objects, each of
them has another QList inside them, so it's a minimum of 2 INSERT's and
one UPDATE per object. Statements are simplest possible so it's hard to
get it wrong and i don't think it's the SQL code to blame.
Why this could be happening?
Best regards,
Anatoly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5238 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101103/7126538d/attachment.bin
More information about the Qt-interest-old
mailing list