[Qt-interest] QString ot QUuid for QHash and QMap keys?
Jason H
scorp1us at yahoo.com
Fri Oct 21 20:21:49 CEST 2011
Yeah, I can find the quickest, but I was hoping for some insight :-)
From: Andre Somers <andre at familiesomers.nl>
To: qt-interest at qt.nokia.com
Sent: Friday, October 21, 2011 1:13 PM
Subject: Re: [Qt-interest] QString ot QUuid for QHash and QMap keys?
Op 21-10-2011 19:08, Jason H schreef:
I am wondering which if the following results in fastest lookups. I've got about 500-100o items in the collection, and I will constantly be doing lookups as the system gets the UUID for an object then proceeds to manipulate that object potentially several times a second, for each object.
>QMap<QUuid, QObject*>
>QHash<QUuid, QObject*>
>QMap<QString, QObject*>
>QHash<QString, QObject*>
>
>Where the string keys are a QUuid::toString().mid(1,36) (trims the curley braces).
>
>Also, why isn't there a toString() version that will just give me a string without the braces? I keep making Uuids, converting them to strings and cutting the braces off.
>
>Thanks.
>The QHash versions are going to be faster than the QMap ones, but I am not sure which of the hashes will be faster. I guess the QUuid one, but that would be easy enough to benchmark, right?
André
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111021/b3d71f8d/attachment.html
More information about the Qt-interest-old
mailing list