Tatsuhiko Miyagawa's Blog

Perl QA Hackathon 2015 Day 4

April 20, 2015

I’ve been constantly annoyed by the slowness of plenv rehash. The rehash command is automatically called after every run of cpanm if you install it through plenv, and it could get slower if you have 20+ perl versions managed by plenv.

I debugged this with PLENV_DEBUG=1 option a little bit and found out what’s slow is bash function call. I’ve made some of the function calls in rehash script as an inline call, and that helped a little bit, but in the end i figured I couldn’t make this faster without a gross hack.

The fundamental problem was that I have way too many perl versions managed, so I deleted all of odd-number dev perls and -RC releases. And now plenv rehash runs in < 2s. Still noticeable, but I can bear with that.

The next step is to eliminate the automatic call of plenv rehash in cpanm shim, and make it more appropriate plugin a la rbenv’s rehash plugin.

There’s also a confusion about what command line arguments plenv install can take, and I sent a pull request to fix the documentation, which has been merged by now.

cpanm, Carton

cpanm with the better cpanfile requirement support has been now shipped as 1.7030.

Carton has been updated to remove some modules from its dependencies, such as Exception::Class and Moo. Carton is meant to be installed via regular cpanm and does not affect the hosted runtime application, but given how carton is required to bootstrap a deployment process, having less dependencies is a good thing, unless it scarifies the maintainability of the code too much.

Now its non-core dependencies for perl 5.20 is down to 6, which was previously 17. It is shipped to CPAN as 1.0.14.


I continued working on Carmel and added some optimizations, so that carmel install will only install the missing modules, rather than throwing everything against cpanm and see what it does.

It makes carmel install much faster, and works perfectly even if you’re offline and have all modules already installed.

After the dinner I showed a quick demo of CArmel to charsbar, rjbs and xdg and they’re all excited about how it works, and have given me a lot of advices to make this more optimized. Right now there’s absolutely no optimization and it’s still a 1 sec overhead in the runtime. I’m sure I can manage it by < 200ms realistically.


During the process of migrating Carton from Moo to Class::Tiny, I found some odd behavior in Class::Tiny where a custom accessor are not called in constructor arguments. It was confusing to me, but is arguably by design and I just worked around it with another way.

PAUSE on Plack

charsbar++ ported PAUSE web app to Plack, and ANDK++ has configured it on the staging environment and it actually is live, under the different hostnames from the regular one.

It’s a great start, and contributing to PAUSE by writing tests for it or adding features (API? yes?) would be so much easier now.

When we saw the site go live there’s a big cheer of applause and hugs going around. I couldn’t be happier!

Bose QC20

By the way I have brought QC20 from Bose for this trip, and it has served so well.

The hackathon is a great place to work with a bunch of hackers, and it could sometimes be distracting when interesting things are going on around you. QC20 absolutely cuts of all the ambient noise and gives the perfect focus on me during the session — that’s how I missed the group shot because I was so focused in the corner of the room!

Wrap Up

Thank you Tina for organizing the hackathon and all attendees to make the hackathon more meaningful and enjoyable to work with.

Big thanks to the sponsors who made this hackathon possible:

amazon Development Center,
Travis CI,
GFU Cyrus AG,
infinity interactive,
Frankfurt Perl Mongers,
Perl 6 Community,
Les Mongueurs de Perl,
YAPC Europe Foundation,
Perl Weekly,
qp procura,
Campus Explorer

Enjoyed and loved Berlin so much and I can’t wait to come back.