more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Use the Benchmark module. It will let you know relative speeds.
From what I've tested, method calls are around 20% slower. So, the question for your stuff is, do you need inheritance. If you do, then that answers it easily. Are your calls (to either function or method) in a tight loop (are there many iterations). If not, then again, the OOP might not be that bad (if it only takes one method call to get the whole thing rolling and you don't use the method calls after that, then by all means use OOP). Another thing to consider is that if you are not using inheritance you can do things like this. When inheritance is not involved $obj->my_method( @args ); is the same as &MyObj::my_method( $obj, @args );. The only difference is speed. my @a=qw(random brilliant braindead); print $a[rand(@a)]; In reply to Re: Object Oriented Perfomance
by Rhandom
|
|