Subject: | Load the XS Implementation if Available |
Hi:
Audrey Tang has written a module which re-implements the LCSidx command
in XS/C. This means that compact_diff is accelerated in that package.
I'm not personally sure if it always provides the same output, so this
idea needs further investigation, but it would be nice if
Algorithm::Diff either:
1. Accelerated itself using Algorithm::Diff::XS if installed (ie, have
require Algorithm::Diff::XS in an eval, and remap internal LCSidx to the
XS implementation)
2. Adopted this LCSidx implementation (assuming licensing is
compatible) by copying the XS
3. Requesting a takeover of ::XS or comaintainership from Audrey
Option 1 takes the XS implementation out of your control, which is bad
in the case where there are bugs and Audrey doesn't (for whatever
reason) fix them -- making Algorithm::Diff look bad -- but being outside
of your control.
Option 2 might cause some issues on systems where C/XS modules can't be
built (ie those without compilers). It might be tricky to hack in
detection and optional fallback where XS is unavailable (which is why I
prefer to use ::XS modules myself)
Option 3 seems the best option at this time.
Of course there may be others.
Thanks for reading and considering this. Audrey's benchmarks in
Algorithm::Diff::XS look impressive, and it might be useful for various
applications, particularly when using this algorithm as part of a web
application, as it means you can serve more users at once.
Cheers,
Jonathan