Well, I remembered that, as I read your post, and did a little research.
Conway mentions the speed thing in his book Object Oriented Perl (as you already mentioned).
Luckily Manning Publications has the preface of that book online, so let's quote from there:
Quoted from section "What object-oriented Perl isn't"
Because Perl wasn't originally designed as an object-oriented language, object-oriented Perl isn't fast. Calling a method through an object is significantly slower than calling a regular Perl subroutine. Just how much slower is a matter of some debate, and depends on whether you measure entire software systems or just raw single-call invocation speed.
A single method call is about 30 percent slower than a regular call to the same subroutine (depending on your hardware, your operating system, the phase of the moon, etc.) But though they're individually much slower, method calls are more powerful than regular subroutine calls, due to a feature known as polymorphism (see chapters 1 and 7). In a larger system, that redresses the speed imbalance in a little, but, in general, it's fair to say that an object-oriented implementation of a system in Perl will almost never be faster than the equivalent non-object-oriented implementation, and will usually be somewhere between 20 to 50 percent slower.
...
The sad thing is that people get spooked by the numbers (20 to 50 percent slower!!!) and forget what that really means (...just as fast in six months time, when processor speeds have doubled).
I never did some benchmarking on my own to determine how much slower OO Perl is on my machines. I trust Conway in this matter and try to enjoy the benefit of OO (as I'm learning OO) ;o)
In reply to Re^2: Trying to understand Perl Objects
by linuxer
in thread Trying to understand Perl Objects
by tamaguchi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |