On Wed, 28 Dec 2005, Jeff Pang wrote:

> Why the a.pl is faster than b.pl? I think ever the resulte should be 
> opposite.Thanks.

The easiest way to answer such questions is to benchmark and profile 
where the time in each script is being spent.

These two scripts are so different in composition that it isn't 
immediately obvious to me how they're similar or dis-similar.

You have two approaches you can try for answering such questions:

* have two nearly identical scripts, and measure how the small
  different part impacts performance.

* break each script into components and measure how long each
  component takes to complete its task.

These approaches can be intermixed as needed, but it's up to you to do 
the fundamental measuring of your code for yourself. 

Distill the question down to something clearer -- "why is statement (or 
subroutine) A faster than statement B while having the same result" -- 
and you may find more concrete advice from the list members.


-- 
Chris Devers
DO NOT LEAVE IT IS NOT REAL

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to