130 lines
3.0 KiB
HTML
130 lines
3.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Algorithm::Diff::XS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Algorithm::Diff::XS</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-10-27<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Algorithm::Diff::XS - Algorithm::Diff with XS core loop
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
# Drop-in replacement to Algorithm::Diff, but "compact_diff"
|
|
# and C<LCSidx> will run much faster for large data sets.
|
|
use Algorithm::Diff::XS qw( compact_diff LCSidx );
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This module is a simple re-packaging of Joe Schaefer's excellent
|
|
but not very well-known Algorithm::LCS with a drop-in interface
|
|
that simply re-uses the installed version of the Algorithm::Diff
|
|
module.
|
|
<P>
|
|
|
|
Note that only the <TT>"LCSidx"</TT> function is optimized in <FONT SIZE="-1">XS</FONT> at the
|
|
moment, which means only <TT>"compact_diff"</TT> will get significantly
|
|
faster for large data sets, while <TT>"diff"</TT> and <TT>"sdiff"</TT> will run
|
|
in identical speed as <TT>"Algorithm::Diff"</TT>.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>BENCHMARK</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
Rate Algorithm::Diff Algorithm::Diff::XS
|
|
Algorithm::Diff 14.7/s -- -98%
|
|
Algorithm::Diff::XS 806/s 5402% --
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
The benchmarking script is as below:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
my @data = ([qw/a b d/ x 50], [qw/b a d c/ x 50]);
|
|
cmpthese( 500, {
|
|
'Algorithm::Diff' => sub {
|
|
Algorithm::Diff::compact_diff(@data)
|
|
},
|
|
'Algorithm::Diff::XS' => sub {
|
|
Algorithm::Diff::XS::compact_diff(@data)
|
|
},
|
|
});
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
Algorithm::Diff, Algorithm::LCS.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
|
|
|
|
Audrey Tang <<A HREF="mailto:cpan@audreyt.org">cpan@audreyt.org</A>>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 2008 by Audrey Tang <<A HREF="mailto:cpan@audreyt.org">cpan@audreyt.org</A>>.
|
|
<P>
|
|
|
|
Contains derived code copyrighted 2003 by Joe Schaefer,
|
|
<<A HREF="mailto:joe+cpan@sunstarsys.com">joe+cpan@sunstarsys.com</A>>.
|
|
<P>
|
|
|
|
This library is free software; you can redistribute it and/or modify
|
|
it under the same terms as Perl itself.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">BENCHMARK</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">AUTHORS</A><DD>
|
|
<DT id="7"><A HREF="#lbAH">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:35 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|