Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Fast Identification Of String Difference

by Marshall (Abbot)
on Jan 17, 2011 at 17:13 UTC ( #882704=note: print w/replies, xml ) Need Help??

in reply to Fast Identification Of String Difference

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.

  • Comment on Re: Fast Identification Of String Difference

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://882704]
[shmem]: LanX: doesn't reference table formatting. Thx anyways. -.-
[LanX]: ->  Perl Monks Approved HTML tags
[LanX]: -> <table border=1>
[shmem]: Lanx: that just enables the border. Looking up style attributes...
[LanX]: ?
[karlgoethebier]: code><table style="border: 1px solid black;}"></code> same for th and td ?
[shmem]: my scratchpad
[karlgoethebier]: oops!

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (14)
As of 2017-07-24 16:41 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (356 votes). Check out past polls.