LWN.net Logo

Moose

Moose

Posted Mar 22, 2012 2:27 UTC (Thu) by dskoll (subscriber, #1630)
Parent article: Perl 5.16 and beyond

Moose is nice, but... it's a bit of a memory pig. :(

Starting perl on Linux/x86 yields a process with VSZ around 3MB. Executing use Moose; expands that to about 9.5MB.

That might not seem like a lot, but throw in a few more CPAN modules and your memory footprint quickly gets huge.


(Log in to post comments)

Moose

Posted Mar 22, 2012 2:42 UTC (Thu) by autarch (subscriber, #22025) [Link]

This is one reason I'm excited about the possibility of core MOP. That will move some of what Moose does into the core, which will presumably be both faster and more efficient.

Moose

Posted Mar 23, 2012 13:45 UTC (Fri) by jnareb (subscriber, #46500) [Link]

There are varius lighter-weight (but more limited) versions of Moose (or rather Moose-compatibile object systems): Mouse, Moo, Mo, and there is build time equivalent Mite.

Moose

Posted Mar 23, 2012 23:05 UTC (Fri) by dskoll (subscriber, #1630) [Link]

Well, yeah, but let's say you want to use CPAN modules X, Y, Z and W. If X wants Moose, Y wants Mouse, Z wants Moo and W wants Mo, you end up with Mess. :(

Moose

Posted Mar 27, 2012 20:13 UTC (Tue) by jnareb (subscriber, #46500) [Link]

Well, yeah, but let's say you want to use CPAN modules X, Y, Z and W. If X wants Moose, Y wants Mouse, Z wants Moo and W wants Mo, you end up with Mess. :(
Well, there are Any:Moose, Any::Mo modules. For example if you use Any::Mo you are limited to what Mo can do, but you can use any of Mo, Moo, Mouse, Moose which can implement this subset of OOP.

Moose

Posted Mar 29, 2012 3:11 UTC (Thu) by harbud (guest, #83808) [Link]

No, the problem is I cannot control what X, Y, Z, and W uses. X might use Moose specifically and not Any::Moose, Y might use Mouse, and so on.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds