[Development] Container benchmark was HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

Thiago Macieira thiago.macieira at intel.com
Fri Jul 17 03:25:21 CEST 2015


On Thursday 16 July 2015 23:09:55 Gunnar Roth wrote:
> > QHash is slower than std::unordered because std::hash<double> is inline
> > and  qHash(double) is out-of-line.
> 
> May I ask why? 
> Is this valid for all qHash()?

Commit c0791ac76ec7cfdc3945efa67a6f72ee3623413c

    Add qHash() overloads for floating-point types

    Implemented out-of-line to avoid potential FP-comparison warnings, as well
    as to be able to use the file-static hash() functions, which gets inlined
    unlike qHashBits(), which cannot be.
    
It was a tradeoff between a faster inlining into your code and a faster hashing 
algorithm.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list