Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

(tye)Re2: Benchmarking the basic operations

by tye (Sage)
on Jan 30, 2001 at 20:55 UTC ( #55264=note: print w/replies, xml ) Need Help??

in reply to Re: (tye)Re: Benchmarking the basic operations
in thread Benchmarking the basic operations

Sorry, those aren't my terms. :) Dispatching opcodes is a description I've heard of how Perl executes the code that it has compiled. So Perl has a fairly high overhead per opcode.

The constructs to focus on when optimizing are the contructs that take the big chunk of the time. And usually the only big win you have when optimizing is to change the algorithm, that is, change the whole way you do things. Tweaking tiny things here and there is usually a waste of your time.

Now occasionally you can do something simple like change a s/\W+//g to tr/a-zA-Z0-9_//cd and get a big speed improvement IF you are doing that operation on a huge number of really long strings.

Another way to look at is, if you need to use in order figure out which of two ways is faster, then it probably isn't worth your time to be worrying about that "optimization". Using is a good way to figure out how much faster something is. And it can be fun and/or interesting to compare things with But if you don't have a real problem that runs noticeably faster after your change, then the change really didn't make much difference.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re2: Benchmarking the basic operations

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://55264]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2018-05-28 10:43 GMT
Find Nodes?
    Voting Booth?