Algorithm::Diff::XS(3pm)

Algorithm::Diff::XS3pm

Algorithm::diff with xs core loop

Usage

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

Overview

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.

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

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 7 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13

Authors

Audrey Tang <[email protected]>

From libalgorithm-diff-xs-perl 0.04-9 in Debian 13 (Trixie). Parsed by carta from the page's man source.