February 2010 Archives

Converting a Moose application to a Mouse|Moose hybrid

Hailo has been converted from a Moose application to a hybrid Mouse/Moose application for release 0.20.

This brought its memory usage from 28MB to 20MB. Hailo is around 4.000 lines and the patch required to make it Mouse + Moose compatible (including testing both at make test time) is just under 500 lines.

As well as reduced memory use another big plus is the reduced startup time. hailo(1) starts with Mouse in around 250…

Benchmarking MooseX::Method::Signatures v.s. plain subs on Hailo

I'd heard that MooseX::Method::Signatures incurred a substantial runtime performance hit. I wanted to test if that was true so I tried converting Hailo to use it. The result: Yes, it's slow:

Here's how long it takes (real time) to train Hailo with a new brain, the command is:

time hailo --brain megahal.brn --train /tmp/fortune.trn --no-progress

The results:

  • Without MX::MS: 11.37s
  • With MX::MS…

About Ævar Arnfjörð Bjarmason

user-pic Blogging about anything Perl-related I get up to.