ironcamel/App-p — pull request #9 by creaktive (2012-12-26 14:32:41+00:00)
Title: Class::Autouse issue; don't always load File::Slurp, JSON, YAML & LWP

I've noticed the following `superloader` issue:

stas@bp0907:~/App-p$ bin/p 'S DateTime->today'
Can't locate DateTime/Infinite/Future.pm in @INC (...)

So I tried to replace it with the shiny new [L](https://metacpan.org/module/L). Also realized that this mechanism can be used for dynamically loading of JSON::XS, YAML::XS, LWP::Simple and even File::Slurp. The advantage if this approach is a noticeable memory footprint reduction (and faster load time).

Original:

stas@bp0907:~/App-p$ "time" bin/p 'dd \%INC' | wc -l
0.14user 0.00system 0:00.15elapsed 98%CPU (0avgtext+0avgdata 63312maxresident)k
0inputs+0outputs (0major+5947minor)pagefaults 0swaps
92

Dynamic:

stas@bp0907:~/App-p$ "time" bin/p 'dd \%INC' | wc -l
0.07user 0.00system 0:00.08elapsed 100%CPU (0avgtext+0avgdata 26336maxresident)k
0inputs+0outputs (0major+3461minor)pagefaults 0swaps
46

Bare perl, just for comparison:

stas@bp0907:~/App-p$ "time" perl -MData::Dump -E 'dd \%INC' | wc -l
0.00user 0.00system 0:00.01elapsed 85%CPU (0avgtext+0avgdata 11168maxresident)k
0inputs+0outputs (0major+762minor)pagefaults 0swaps
12