Page Execution Time

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ed209
Forum Contributor
Posts: 153
Joined: Thu May 12, 2005 5:06 am
Location: UK

Page Execution Time

Post by ed209 »

I have 2 pages that do exactly the same thing.

1) one does all the work on the page navigated to - thepage.php
2) the other uses a class included on - thepage.php

both pages use very similarly-coded functions, I started with option 1 and used it as a basis to create page 2 and its class.

------
The execution times are as follows:

page 1) 0.04 seconds

page 2) 0.06 seconds
------

so page 2 is 33% slower, however, as it uses a class it is much easier to use throught the site. So i guess the question is, should I compromise page development time over page execution time?

thanks for your thoughts!
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

How busy is your site going to be? 0.02s is nothing to worry about .. unless you're getting 1,000,000 views a day..
User avatar
ed209
Forum Contributor
Posts: 153
Joined: Thu May 12, 2005 5:06 am
Location: UK

Post by ed209 »

I wish!!

per day I'd be happy with 2000 - 4000 visitors (not hits)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I would never dream about not using a class, but were not going to get into that discussion. Perhaps some refactoring elsewhere could improve load times.
User avatar
ed209
Forum Contributor
Posts: 153
Joined: Thu May 12, 2005 5:06 am
Location: UK

Post by ed209 »

My page has now gone up to 0.12 seconds (running of my mac). I've expanded on my classes quite extensively which has meant I can develop and edit pages a lot quicker now but the downside is the longer execution time.

It may well be quicker on the server but I was wondering at what point do you have to re-think the way your developing the code ?

I randomly picked a 0.1 second limit before I would start to worry about it - but I've passed it now so I'd be grateful for any advice.

thanks
ed.
Post Reply