in reply to Binary File Manipulation across Byte boundaries

If your pattern is relatively complex (ie complex enough that you'd want to use the regexp engine rather than index()) it might be worth constructing the 8 shifted variants of the pattern so that you can combine them into a single regexp to run over the target string.

For simple patterns or short strings, unpacking the bytes is probably faster.

I'm not familiar with Bit::Vector, so I don't know where that would fit into the efficiency mix.

(This is a gut feel, I welcome benchmarks agreeing or disagreeing with that. :)

Hugo

  • Comment on Re: Binary File Manipulation across Byte boundaries