On Oct 16, 2011, at 6:57 PM, ext Thiago Macieira wrote: >> One thing I would like to add is the hash, for QString (and potentialy >> QByteArray) >> see: http://qt.gitorious.org/qt/qtbase/merge_requests/62 > > We discussed that but we're not satisfied that it will provide good results. > It > means spending 4 bytes to store the hash as well as hardcoding the hashing > function until Qt 6. Someone mentioned that only 10% of the strings are ever > hashed. In particular, I am not ready to give up a 16-byte alignment for the > hashing. > > Maybe João can give more details of his thinking.
When we discussed this, no one seemed to be much in favor of the change, in subjective terms. One concrete show-stopper is the concern that it makes QString's hashing function part of the ABI. Other concerns, as you mention, are the waste of space and whether the resulting improvement is worth the trouble -- so, 10% of strings are ever hashed, but are there places where we re-hash the same string over and over that other improvements in code would provide better results? I haven't given this much more thought, but I'm wondering if there are places where introducing a QString-compatible QString-extension (say QHashedString) would provide the same benefits... That is something that can be played with before we change QString. Cheers, João _______________________________________________ Qt5-feedback mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt5-feedback
