QHash vs. unordered_map
Milian Wolff
mail at milianw.de
Sun Nov 25 13:36:21 UTC 2012
On Sunday 25 November 2012 00:59:55 Andreas Pakulat wrote:
> Hi,
>
> Just wanted to note that you basically only have confirmation that gcc 4.7
> with qt 4.8.x x>=2 is faster. That being said I doubt the performance
> difference between the hash types makes an actual noticable for the cases
> where its used.
QHash was last changed in 2010. And I doubt they made the C++11/STL
implementation perform worse over the last releases in GCC.
That being said, it could potentially be an issue of course. But now we have
proper benchmarks. If someone reports that for him it's faster with
unordered_map we can still think about bringing it back. I agree with you
though that it's probably not a noticable difference. Esp. considering that
many other performance critical places in KDevelop already use QHash and
perform just well.
Cheers
> Am Samstag, 24. November 2012 schrieb Milian Wolff :
> > On Wednesday 21 November 2012 20:15:58 Milian Wolff wrote:
> > > Hey all,
> > >
> > > can you please share the numbers for a release build running the
> >
> > following
> >
> > > test from KDevplatform:
> > >
> > > language/duchain/tests/itemrepositorytest.shell
> > > testStringHashPerformance
> > >
> > > See 7465cc39f13edc4a4e99cf033a5751c8339018e0 for my numbers. If people
> >
> > can
> >
> > > confirm this, then I'll refactor our code to use QHash and drop the
> > > nasty
> > > ifdef code.
> > >
> > > Cheers
> > >
> > > PS: Looking at the usage of hash_map in KDevelop's cpp parser, I'd say
> >
> > that
> >
> > > its just overdesigned and could also easily be using a QHash.
> >
> > Since I only got confirmations about this finding, I've now committed the
> > refactorings to both KDevelop and KDevplatform. The code is now much
> > cleaner
> > and apparently also faster - neat!
> >
> > Note: We now compile *without* C++11 mode everywhere. This means less
> > accidental breakages. For KDevelop 4.6 I want to change that and make a
> > subset
> > of C++11 a mandatory dependency, but for that see the separate mailing
> > list
> > thread.
> >
> > Cheers
> > --
> > Milian Wolff
> > mail at milianw.de <javascript:;>
> > http://milianw.de
--
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121125/e42198fe/attachment.sig>
More information about the KDevelop-devel
mailing list