|
Posted by Jeff North on 01/13/08 19:38
On Sat, 12 Jan 2008 22:42:11 -0800 (PST), in comp.lang.php
IanReardon@gmail.com
<08d67142-ced8-4e16-a9dc-dc264f4ce749@f47g2000hsd.googlegroups.com>
wrote:
>| I'm trying to optimize a php project of mine and I'm running into some
>| problems.
>|
>| Overall the page takes about .4-.5 seconds to render (just the code,
>| i'm recording the time at start and finish of execution) on a my dual
>| core server with nothing else running (other than httpd and mysqld)
>|
>| I've optimized my queries, total mysql query time is about .1 to .12
>| seconds total.
>|
>| For some reason the part of my php that takes the longest to execute
>| is a rather large section of html code with some <? echo $someVar; ?>
>| sprinkled in. There is no logic or functional calls, yet this block
>| of code (maybe 50 lines of HTML, takes around .3 seconds to execute.
>|
>| Can anyone recomend ways to find out where my php code is executing
>| slow?
>|
>| Thank you
You're joking, right?
Have you stopped to think that it might not be the php code that is
slowing things down?
In another post you show a simple table layout.
Could it be your browser that is causing this 'bottleneck'?
The browser needs to :
read your generated code
parse it
create the DOM structure
render the table
No of the above happens until the </table> tag is reached.
To test this out:
remove all html code from the page and just have your echo statements.
What is the timing?
-- -------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
-- -------------------------------------------------------------
[Back to original message]
|