Remove dependency on List::MoreUtils
authorPeter Rabbitson <ribasushi@cpan.org>
Wed, 24 Jun 2015 15:31:31 +0000 (17:31 +0200)
committerPeter Rabbitson <ribasushi@cpan.org>
Wed, 24 Jun 2015 15:31:31 +0000 (17:31 +0200)
commita1c9c64f601668626864d327aa076d9586b10c4b
tree78aceaa2c44dcb1e33ee7f34f2bfdc62ce04efcd
parentc1f9a59d17b44cff47a15a512a2402a3672156ac
Remove dependency on List::MoreUtils

Current LMU maintainer was proven unresponsive to concerns about the towering
complexity of that modules dependency chain. Use a pure-perl implementation
of uniq() compatible with the version in LMU 0.4xx series

The slowdown, while noticeable, is of no consequence to the larger codebase

~$ dd if=/dev/urandom bs=512 count=1 2>/dev/null | perl -0777 -Ilib -MSQL::Translator::Utils -MList::MoreUtils::XS -MBenchmark::Dumb -e '
  my @list = map ord, split "", <>;

  Benchmark::Dumb::cmpthese( 0.0001 => {
    lmu => sub {
      List::MoreUtils::uniq(@list);
    },
    pp => sub {
      SQL::Translator::Utils::uniq(@list);
    }
  })
'
               Rate    pp    lmu
pp  2838.17+-0.28/s    -- -35.2%
lmu 4381.99+-0.44/s 54.4%     --
Changes
Makefile.PL
lib/SQL/Translator/Role/ListAttr.pm
lib/SQL/Translator/Schema/Trigger.pm
lib/SQL/Translator/Utils.pm