Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Algorithm::Diff::XS

Name Algorithm::Diff::XS
Version 0.04
Located at /usr/local/lib64/perl5
File /usr/local/lib64/perl5/Algorithm/Diff/XS.pm
Is Core No
Search CPAN for this module Algorithm::Diff::XS
Documentation Algorithm::Diff::XS
Module Details Algorithm::Diff::XS

NAME

Algorithm::Diff::XS - Algorithm::Diff with XS core loop


SYNOPSIS

    # 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 );


DESCRIPTION

This module is a simple re-packaging of Joe Schaefer's excellent but not very well-known the Algorithm::LCS manpage with a drop-in interface that simply re-uses the installed version of the the Algorithm::Diff manpage module.

Note that only the LCSidx function is optimized in XS at the moment, which means only compact_diff will get significantly faster for large data sets, while diff and sdiff will run in identical speed as Algorithm::Diff.


BENCHMARK

                      Rate     Algorithm::Diff Algorithm::Diff::XS
Algorithm::Diff     14.7/s                  --                -98%
Algorithm::Diff::XS  806/s               5402%                  --

The benchmarking script is as below:

    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)
        },
    });


SEE ALSO

the Algorithm::Diff manpage, the Algorithm::LCS manpage.


AUTHORS

Audrey Tang <cpan@audreyt.org>


COPYRIGHT

Copyright 2008 by Audrey Tang <cpan@audreyt.org>.

Contains derived code copyrighted 2003 by Joe Schaefer, <joe+cpan@sunstarsys.com>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024