Re: why a.pl is faster than b.pl
- From: cdevers@xxxxxxxxx (Chris Devers)
- Date: Wed, 28 Dec 2005 13:46:54 -0500 (EST)
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
.
- References:
- why a.pl is faster than b.pl
- From: Jeff Pang
- why a.pl is faster than b.pl
- Prev by Date: Re: Each char / letter --> array from string value
- Next by Date: Re: GD::Help !
- Previous by thread: Re: why a.pl is faster than b.pl
- Next by thread: Re: why a.pl is faster than b.pl
- Index(es):
Relevant Pages
|