in reply to Perl's hash table implementation

Hashes live in hv.h and hv.c. I'm not sure what you want to do and how much knowledge of the rest of Perl core is necessary to get there. Mostly, you'll be looking at macros using other macros in hv.h, but if you only aim at the implementation of Perl (memory) hashes, hv.c should be enough, and mostly "real" C code to boot.

Replies are listed 'Best First'.
Re^2: Perl's hash table implementation
by jc (Acolyte) on Oct 07, 2010 at 09:11 UTC

    Hi,

    Basically, the kind of programming I do involves a lot of hash table work. This makes Perl an attractive technology for me because of its simple hash table interface. When doing an MSc in High Performance Computing I was not allowed to use Perl because my dissertation could not have been taken seriously because, and I quote from my supervisors, 'only C and Fortran are taken seriously as High performance programming languages'. So for my disssertation I had to use a less simple hash table C interface like http://www.cl.cam.ac.uk/~cwc22/hashtable/

    And so, in a nutshell, I was just interested in comparing these Hash table implementations. Anyway, thanks for pointing me in the right direction.
      This makes Perl an attractive technology for me because of its simple hash table interface.
      Yeah, but the implementation is focussed on Perl. It's certainly not a wrapper around an external C library. It won't be simple to lift the hash implementation out of perl, and adapt it for another language, and still have something that blends well with that language.
      only C and Fortran are taken seriously as High performance programming languages
      There may be a few others (or not...), but Perl certainly isn't known for being suitable as a "high performance" language when it comes to number crunching, or dealing with massive amounts of in-memory data.
      I don't know if it would be useful for your purposes, but you might be interested in PDL:

      PDL is the Perl Data Language, a perl extension that is designed for scientific and bulk numeric data processing and display. It extends perl's syntax and includes fully vectorized, multidimensional array handling, plus several paths for device-independent graphics output.

      PDL is fast, comparable and often outperforming IDL and MATLAB in real world applications. PDL allows large N-dimensional data sets such as large images, spectra, etc to be stored efficiently and manipulated quickly.