|
Author |
Message |
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Tue May 07, 2002 12:17 pm (21 years, 11 months ago) |
|
Is there a good way of gauging how efficent (or not) a script is, especially ones involving database calls?
I can get things to work, but being self taught at PHP I'm never sure whether I'm doing things in the best way |
|
|
|
|
Peter
Team Member
Joined: 09 Jan 2002
Posts: 147
Location: UK
|
Posted:
Wed May 08, 2002 3:44 pm (21 years, 11 months ago) |
|
There's a very nice benchmark/timer class in pear (find it in the cvs @ [url]cvs.php.net[/url] under pear -> Benchmark_Timer) which works well. Takes a little bit of getting used to though
Peter. |
________________________________ Maple Design - quality web design and custom programming |
|
|
|
Garth Farley
WebHelper
Joined: 08 Jan 2002
Posts: 69
Location: Ireland
|
Posted:
Thu May 09, 2002 9:12 am (21 years, 11 months ago) |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Thu May 09, 2002 9:30 am (21 years, 11 months ago) |
|
Garth Farley wrote: | You can call microtime() at the beginning and end of the program, and find the difference between the two.
I think this tutorial has everything you need Timing Script Execution from PHPBuilder.com
Garth Farley |
Trouble with that is you only have yourself as a benchmark, I guess it would be useful for seeing if you have improved something though.
I'm thinking there is no easy answer, accept do a bit more reading, learning and practicing and of course visiting this forum |
|
|
|
|
Garth Farley
WebHelper
Joined: 08 Jan 2002
Posts: 69
Location: Ireland
|
Posted:
Thu May 09, 2002 4:02 pm (21 years, 11 months ago) |
|
A more useful thing to have implimented is for the page to update a log on how long each page executes. Then you can consult the log regurally to see if things are slowing up or what. MySql can be unpredictable, qeuries are queued, the system processor can be tied up with other things, there are many variables.
To see if a new request is better than others, run the PHP script a few times, and get the average of the values. This is a more accurate way of testing page times.
Garth Farley |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.1296 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |