in reply to Re^5: Bit vector fiddling with Inline C
in thread Bit vector fiddling with Inline C
Thanks! Re this point >>BTW: You still haven't mentioned what the "complex processing" you are performing in XS is?<< -- sorry, not trying to be mysterious, was just trying to keep the question focused!
One real example is this: there are 2 bit vectors of different sizes (each in the range of 1-8m bits) with irregular, many-to-many relationships between the bits in each vector. (The relationships are represented separately by a long array of pairs of ints.) One real function is to find every set bit in vector A, then set the corresponding bit(s) in vector B.
So: simple bitwise ops are out of the question because the vectors are of different sizes. I coded it first in pure Perl using the vec() function, but it was pretty slow (one call to vec() to test/set each bit). So, I switched to Inline::C for the heavy lifting and it's now over 20x faster (ie. the entire test/set loop inside one C function).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Bit vector fiddling with Inline C
by syphilis (Archbishop) on May 10, 2011 at 02:12 UTC | |
by BrowserUk (Patriarch) on May 10, 2011 at 07:06 UTC | |
by syphilis (Archbishop) on May 10, 2011 at 23:45 UTC | |
by BrowserUk (Patriarch) on May 11, 2011 at 01:01 UTC | |
by syphilis (Archbishop) on May 11, 2011 at 01:32 UTC | |
by oxone (Friar) on May 10, 2011 at 08:11 UTC | |
by BrowserUk (Patriarch) on May 10, 2011 at 14:34 UTC | |
by oxone (Friar) on May 10, 2011 at 05:56 UTC |