in reply to Faster creation of Arrays in XS?

Depending on what you want to do, it might be faster to keep the data structure in C land and access it through a tied array or unpack from the Perl side. You can gain a tiny speedup by using av_make to create the array in the DIFF_MATCH case (see perlguts on working with arrays).

I would look at using "bind" variables and writing the data from e directly into these variables instead of (re)allocating new Perl data structures every time. DBI has this for the maximum speed at a cost of convenience.

Replies are listed 'Best First'.
Re^2: Faster creation of Arrays in XS?
by wollmers (Scribe) on Jun 21, 2015 at 21:03 UTC

    Thx corion. I will try your ideas.But still shake my head about slowness of arrays.