I looked for a Perl module that would do this with 'C' XS code and couldn't find one. I found one module with the right functionality, but alas it was pure Perl and not very fast. That surprised me because I've seen similar buffer comparison questions before.
The 'C' code in a C program for something like this would be very fast. I haven't written an XS module myself yet and I don't know how efficient the transfer of information is between Perl and C. The hard part isn't the C code, it is how to interface it with Perl.
As far as assembly language goes, for comparing byte buffers together, in Intel x86 assembly, there is a single machine instruction that can do this. That would be as fast as it could be done.
If anybody writes an XS module to do this, I would like to see it and would like to help with it if desired.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||