From: Rafael Garcia-Suarez Date: Mon, 10 Sep 2007 08:19:58 +0000 (+0000) Subject: Remove the "performance considerations" paragraph. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58852444fed22b881d4d7c0fb448bf375e4033c1;p=p5sagit%2Fp5-mst-13.2.git Remove the "performance considerations" paragraph. p4raw-id: //depot/perl@31836 --- diff --git a/lib/mro.pm b/lib/mro.pm index a9f3927..858b8e5 100644 --- a/lib/mro.pm +++ b/lib/mro.pm @@ -315,45 +315,6 @@ In simple cases, it is equivalent to: But there are some cases where only this solution works (like C); -=head1 PERFORMANCE CONSIDERATIONS - -Specifying the mro type of a class before setting C<@ISA> will -be faster than the other way around. Also, making all of your -C<@ISA> manipulations in a single assignment or push statement -will be faster that doing them one by one (which is what -C does currently). - -Examples: - - # The slowest way - package Foo; - use base qw/A B C/; - use mro 'c3'; - - # Equivalently slow - package Foo; - our @ISA; - require A; push(@ISA, 'A'); - require B; push(@ISA, 'B'); - require C; push(@ISA, 'C'); - use mro 'c3'; - - # The fastest way - # (not exactly equivalent to above, - # as base.pm can do other magic) - package Foo; - use mro 'c3'; - require A; - require B; - require C; - our @ISA = qw/A B C/; - -Generally speaking, every time C<@ISA> is modified, the MRO -of that class will be recalculated because of the way array -magic works. Cutting down on unecessary recalculations is -a win, especially with complex class hierarchies and/or -the c3 mro. - =head1 SEE ALSO =head2 The original Dylan paper