Hash class problem
Andreas Pakulat
apaku at gmx.de
Tue Sep 23 12:11:17 UTC 2008
On 23.09.08 01:25:48, David Nolden wrote:
> Am Dienstag, 23. September 2008 01:07:45 schrieb Hamish Rodda:
> > If we really need the performance, it was suggested by either Roberto or
> > Adam a long time back that we use Google's sparse hash - they have two
> > versions, one optimised for memory consumption, and one optimised for
> > speed. If ever anyone needs efficient hash classes, it's google...:
> >
> > http://code.google.com/p/google-sparsehash/
>
> Well, not sure if it would be worth the effort. Maybe, I haven't looked to
> much at those google classes yet. What we need is a hash with fast
> lookup+insertion, the rest doesn't really matter.
Isn't that actually the specification of a hash? I mean both lookup as
well as insertion should be fast on any proper hash implementation -
unless your hashing functions is very complex.
> Might be useful if it would be possible to just copy one or two of those
> google headers into our kdevplatform/utils directory so we'd have a simple
> and efficient STL-style hash class for general usage in caches and such.
I wouldn't mind having a cross-platform hash class in our utils library,
for cases when QHash doesn't fit the bill. OTOH currently all platforms
that people actively compile kdevelop on (linux+win32) are covered,
because they can use hash_map from gcc or msvc, which even have the same
API. So unless someone wants to do "the work" to make our code "more"
crossplatform for future mac/solaris ports I guess we can live with what
we have.
Andreas
--
You've been leading a dog's life. Stay off the furniture.
More information about the KDevelop-devel
mailing list