[Qt-interest] Different speed for different-sized lists?
Anatoly Burakov
burakov.anatoly at gmail.com
Tue Nov 2 11:12:07 CET 2010
On 02.11.2010 9:37, Konrad Rosenbaum wrote:
> 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
As a programmer i know that there is no black magic in programming, but:
* there are no commits to the database until importing is finished
* frequency of progress bar updates stays the same - every 10 objects.
whether it's 20 or 140'000, it still remains "every 10 objects" - or am
i missing something here? I mean, i do actually write how many objects i
have written and how many of them are there so it's not like i'm taking
these values from a progress bar. Not to mention the progressbar is in
the same thread (just a quick QDialog i assemble on site and update it
via QProgressBar::setValue(int)). I know my code - nothing except the
data amounts changes.
-------------- 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/20101102/f9535952/attachment.bin
More information about the Qt-interest-old
mailing list