missingthepoint has asked for the wisdom of the Perl Monks concerning the following question:
Howdy.
Suppose I have an object which doesn't inherit, nor is it inherited from. Can I then say something like this:
my $foo = Foo->new; Foo::frequently_called_method($foo, @args);
... to speed things up? This implies 2 specific questions:
As a side note, is
equivalent to the above? If so, it it faster or slower?my $foo = Foo->new; my $method = Foo->can('frequently_called_method'); $method->($foo, @args);
Thanks for your insight. :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can you speed up method calls by eliminating method dispatch?
by moritz (Cardinal) on Jul 08, 2009 at 12:23 UTC | |
by missingthepoint (Friar) on Jul 08, 2009 at 12:36 UTC | |
Re: Can you speed up method calls by eliminating method dispatch?
by ikegami (Patriarch) on Jul 08, 2009 at 17:00 UTC | |
by missingthepoint (Friar) on Jul 09, 2009 at 04:57 UTC | |
by ikegami (Patriarch) on Jul 09, 2009 at 15:36 UTC | |
by missingthepoint (Friar) on Jul 10, 2009 at 03:40 UTC | |
Re: Can you speed up method calls by eliminating method dispatch?
by Anonymous Monk on Jul 08, 2009 at 12:20 UTC |