in reply to Re: Can you speed up method calls by eliminating method dispatch?
in thread Can you speed up method calls by eliminating method dispatch?

OK - I was thinking I had a case where it might be appropriate, but your first comment made me realize that while I might be OK with limiting my code's extensibility, I would be making things harder for other people who want to inherit from my object. I guess I wasn't thinking very socially :)

I will indeed benchmark it... I didn't know method lookup is cached, but it wouldn't surprise me considering the years of optimizations Perl 5 has had (is that documented anywhere? I can find NOTE: can directly uses Perl's internal code for method lookup, and isa uses a very similar method and cache-ing strategy in perlobj).


The zeroeth step in writing a module is to make sure that there isn't already a decent one in CPAN. (-- Pod::Simple::Subclassing)
  • Comment on Re^2: Can you speed up method calls by eliminating method dispatch?