alfarid23 has asked for the wisdom of the Perl Monks concerning the following question:

greetings to you, monks.
number of my friends, seasoned c++ programmers, advised that google has couple of a very(most?..) efficient hash implementations open-sourced and ready for use under BSD license, which is using STL.
http://goog-sparsehash.sourceforge.net
So i was thinking to attempt to write a perl module to encapsulate google's algorithms and provide efficient hash functionality for perl both for speed and size. to be concrete, i seek advise whether i should attempt this, and should i use XS vs. SWIG or maybe something entirely different to wrap that monster.
thank you, farid.

p.s.: another g-project, that would be nice to wrap to analyze apache modperl2 threaded is, and possibly improve malloc behaviour: http://goog-perftools.sourceforge.net/

Replies are listed 'Best First'.
Re: google sparse hash project
by grinder (Bishop) on May 31, 2006 at 10:17 UTC
Re: google sparse hash project
by Joost (Canon) on May 31, 2006 at 09:25 UTC
Re: google sparse hash project
by salva (Canon) on May 31, 2006 at 09:17 UTC
    Perl already supports hashes as a native datatype, so there would be little benefit in adding support for another implementation. The extra overhead caused by the wrapping would probably cancel any possible performance gain.

    Besides that, template based C++ libraries are not good candidates for wrapping because the templates have to be instantianted at compile time and that doesn't match well with the semantics of a dynamic language as Perl.

A reply falls below the community's threshold of quality. You may see it by logging in.