Removing Moose and the case for Mouse

I thought I'd write my own practical version of Moose::Manual::Unsweetened by converting Hailo away from Moose. The resulting hack passes all of Hailo's tests but not surprisingly it wasn't worth it.

I wanted to see if I could get the startup time of Hailo down since Moose doesn't incur a runtime penalty once all your classes have been constructed. Here's how much time it takes the three version of Hailo to start up and reply to input, and how much (RSS) memory they use:

  • Hacky Perl OO: 100ms / 5.6MB
  • Mouse: 150ms / 7.4MB
  • Moose: 350ms / 12MB

Mouse seems to get a lot of flak within Moose circles for not being a 100% complete Moose implementation. I previously wrote about how you can maintain dual support for Moose and Mouse in a previous posting.

In future programs I'll be using Mouse as the default with a fallback to Moose. It does everything I need from Moose and doesn't suffer from the high startup time / memory use that's frequently cited as an objection to Moose-based applications.

If that doesn't convince you, here's a mouse riding a frog:

Ribbit! Ribbit!

11 Comments

I'm not sure how compelling the memory argument is. Memory isn't free, but it's not that expensive. If you launch 100 processes, your Moose version needs approximately 480MB more. That's about $20 if you buy nice ECC ram in 4GB sticks.

Also, besides not being a complete Moose implementation, using Mouse severely restricts what extensions are available. Of course, you could always reimplement even more extensions for Mouse, but is that the best use of programming time?

"If you launch 100 processes, your Moose version needs approximately 480MB more. That's about $20 if you buy nice ECC ram in 4GB sticks."

Actually, that's about $20 a month if you're running these processes on a VPS.

So if the author of Mouse says to use Moose instead...why are you telling people to do the opposite?

Fair 'nuff... :-)

"If you launch 100 processes, your Moose version needs approximately 480MB more. That's about $20 if you buy nice ECC ram in 4GB sticks." Actually, that's about $20 a month if you're running these processes on a VPS.

No, it's $160 a month to run 2.8GB instance on linode. :)

I was on the fence, but that mouse riding on the frog completely sold me.

There's no question.

I still think people should generally not use Mouse, for whatever my opinion is worth. That said, Goro Fuji is doing a good job maintaining Mouse. It's in good hands now.

Excellent article, but my favorite part was definitely the mouse on top of a frog LOL - they are great buddies apparently

Indeed, every article needs a funny picture!

Leave a comment

About Ævar Arnfjörð Bjarmason

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