Results 1 to 8 of 8
-
1st Feb 2012, 08:30 PM #1OPMemberWebsite's:
maxneeds.info<?php tag question
Hi there.
I was wondering if i have many <?php tags in a single page - does that slow down the processing ?
Like
<?php echo 1; ?>
<?php echo 2; ?>
Of course that's a silly example .. i am talking about much more complex stuff.
ThanksPorsche_maniak Reviewed by Porsche_maniak on . <?php tag question Hi there. I was wondering if i have many <?php tags in a single page - does that slow down the processing ? Like <?php echo 1; ?> <?php echo 2; ?> Of course that's a silly example .. i am talking about much more complex stuff. Thanks Rating: 5
-
1st Feb 2012, 08:42 PM #2Member
You can try it your self.
By this code:
PHP Code:<?php
$time_start = microtime(true);
// Your stuff here....
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Process took $time seconds\n";
?>
But try and let us also know.No Signature This Time
-
1st Feb 2012, 08:49 PM #3Member
This site is using a hacked database of W junction
Last edited by Gavo; 4th Jan 2015 at 02:31 PM.
-
1st Feb 2012, 08:53 PM #4OPMemberWebsite's:
maxneeds.infoYea that's was a good idea.
So i tested for 4 echo's - 1st test was with only 1 php tag. So in each refresh it was giving different results but average of 1.45 sec.
And 2nd test with 4 more php tags (for each echo) gave average result of 1.47 sec.
So i guess it is really close and no worry about using many php tags. Thanks
EDIT : But hey it has 0.02 delay ! LOL
-
1st Feb 2012, 09:05 PM #5MemberWebsite's:
FlowForums.comI think it wouldn't matter. I use php tags all day to link in files.
-
1st Feb 2012, 09:14 PM #6Member
on micro level it does matter. Every letter is one byte and use memory and process, but most people don't notice it. I even asked Chuck Norris and he didn't notice it. He had to slow time...
-
1st Feb 2012, 09:20 PM #7The Wise OneWebsite's:
twilight.ws ddlrank.comExcellent example of premature code optimization. Stuff like this doesn't matter at all. You code in a structured and clean way to avoid any speed issues and in the end if you are still experiencing slowness you identify the bottleneck and eliminate it ;-)
Sent from my super awesome Samsung Galaxy S III can always be contacted by sending a tweet @twilightws
-
1st Feb 2012, 10:35 PM #8MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comusing separate tags helps in one condition: you have static html contents withing the pages (eg global page layout and html tags) so you put them outside php tags because you don't need php to process them and they are sent directly. Obviously you would win a couple of milliseconds
JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Little question
By manthing in forum PaypalReplies: 4Last Post: 27th Jun 2012, 10:46 AM -
DLE question
By Divvy in forum Webmaster DiscussionReplies: 4Last Post: 2nd Apr 2011, 03:00 PM -
question about windows server before i buy and question about wrzhost
By priviet02 in forum Hosting DiscussionReplies: 5Last Post: 3rd Jan 2010, 05:23 PM -
question
By priviet02 in forum Hosting DiscussionReplies: 2Last Post: 24th Sep 2009, 02:07 PM -
Question!
By Luke in forum General DiscussionReplies: 8Last Post: 23rd Sep 2009, 03:30 PM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...