<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dana: Agreed that performance is a consideration but Moose != MooseX::Declare!! Moose does have its startup costs, but MooseX::Declare has runtime costs *far* greater than either Moose or plain old classes.</div><div><br></div><div>I'm a big fan of Method::Signatures::Simple myself, because I don't need runtime type-checking on individual method arguments enough to pay the considerable price.</div><div><br></div><div>If you redo p2 with this code --</div><div><br></div><div><div>   package Foo;</div><div>   use Moose;</div><div>   use Method::Signatures::Simple;</div><div>   </div><div>   method adder ($ct) {</div><div>       return $ct + 1;</div><div>   }</div><div>   </div><div>   1;</div><div><br></div><div>I think you'll find the performance to be much closer to p1 than p2.</div></div><div><br></div><div>Jon</div><br><blockquote type="cite"><div><div>dana@hithlum:~/bench$ cat p1</div><div>#!/usr/bin/perl</div><div><br></div><div>my $foo = {};</div><div>bless $foo, 'Foo';</div><div><br></div><div>my $counter = 1;</div><div>for(1..100000) {</div><div>    $counter = $foo->adder($counter);</div><div>}</div><div>print "$counter\n";</div><div><br></div><div>package Foo;</div><div><br></div><div>sub</div><div>adder {</div><div>    return $_ + 1;</div><div>}</div><div><br></div><div><div>dana@hithlum:~/bench$ time ./p1</div><div>100001</div><div><br></div><div>real    0m0.045s</div><div>user    0m0.044s7</div><div>sys     0m0.000s</div><div>dana@hithlum:~/bench$ cat p2</div><div>#!/usr/bin/perl</div><div><br></div><div>use lib '.';</div><div>use Foo;</div><div><br></div><div>my $foo = Foo->new;</div><div>my $counter = 1;</div><div>for(1..100000) {</div><div>    $counter = $foo->adder($counter);</div><div>}</div><div>print "$counter\n";</div><div>dana@hithlum:~/bench$ cat Foo.pm </div><div>use MooseX::Declare;</div></div><div><div><br></div><div>class Foo {</div><div>    method adder (Num $ct) {</div><div>        return $ct + 1;</div><div>    }</div><div>}</div><div>dana@hithlum:~/bench$ time perl ./p2</div><div>100001</div><div><br></div><div>real    0m13.718s</div><div>user    0m13.661s</div><div>sys     0m0.044s</div><div>dana@hithlum:~/bench$ </div></div><div><br></div><div>I write code using Moose and the wide galaxy of exceptional modules it has spawned every day.  And I yearn for the day that I can use Perl6 in my production environment.  (It's getting close, last time I looked!)  But sometimes raw 'cpu' performance is important.</div><div><br></div><div>Most of the time, I start using the highest-level modules possible, and if there's a performance problem, I end up 'dumbing down' the hot-spots, using simpler Perl.  For me, this is rare.</div><div><br></div><div>Cheers,</div><div>-Dana</div><div><br><div class="gmail_quote">On Tue, Apr 10, 2012 at 2:00 PM, Randal L. Schwartz <span dir="ltr"><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">>>>>> "Dodger" == Dodger  <<a href="mailto:el.dodgero@gmail.com">el.dodgero@gmail.com</a>> writes:<br><br>Dodger> So... How about some old school perl without mooses and meeses?<br>Dodger> Anybody out there code in... You know... Perl?<br><br>Seriously, if you're launching green code and not using Moose, you have<br>some weird nostalgia in you that prevents you from being a useful coder<br>for me or my clients.<br><span class="HOEnZb"><font color="#888888"><br>--<br>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - <a href="tel:%2B1%20503%20777%200095" value="+15037770095">+1 503 777 0095</a><br><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> <URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>><br>Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>See <a href="http://methodsandmessages.posterous.com/" target="_blank">http://methodsandmessages.posterous.com/</a> for Smalltalk discussion<br></font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>SanFrancisco-pm mailing list<br><a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm" target="_blank">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a><br></div></div></blockquote></div><br></div></div>_______________________________________________<br>SanFrancisco-pm mailing list<br><a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br>http://mail.pm.org/mailman/listinfo/sanfrancisco-pm<br></blockquote><div><br></div></body></html>