SitePoint Sponsor |
|
User Tag List
Results 51 to 59 of 59
Thread: Php "compiler" class
-
Jun 26, 2004, 09:44 #51
- Join Date
- Sep 2003
- Location
- Glasgow
- Posts
- 1,690
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by firepages
I'd really like to nail this down once and for all. My position is that the cost of a single include is of the order of tens of thousandths of a second (on a slow-ish machine). You'd have to have an awful lot of includes before that becomes an issue.
A simple if not very scientific test:
PHP Code:/*
test includes
*/
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
/*
run this once to create some empty files for testing
*/
mkdir('c:/includes_test', 0755);
for($i=0; $i<50; $i++)
{
$fp = fopen('c:/includes_test/file_' . $i . '.txt', 'wb');
fclose($fp);
}
/*
next, run this:
*/
$start = getMicroTime();
for($i=0; $i<50; $i++)
{
include('c:/test/file_' . $i . '.txt');
}
echo round(getmicrotime() - $start, 6) . '<br />';
$start = getMicroTime();
include('c:/test/file_1.txt');
echo round(getmicrotime() - $start, 6);
Originally Posted by firepages
-
Jun 26, 2004, 11:07 #52
- Join Date
- Aug 2000
- Location
- Bay Area, CA; (Pasadena, CA this fall)
- Posts
- 61
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The gains are crucial on a shared hosting server
-
Jun 26, 2004, 12:19 #53
- Join Date
- Sep 2003
- Location
- Glasgow
- Posts
- 1,690
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why?
-
Jun 27, 2004, 07:50 #54
- Join Date
- Jun 2003
- Location
- Chicago
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by webhappy
-
Jun 27, 2004, 08:42 #55
- Join Date
- Sep 2003
- Location
- Glasgow
- Posts
- 1,690
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
But you can always improve hardware by upgrading your account or getting a better host.
If a site is struggling under peak demand small percentage speed increases (if you managed to get even that) would not really help.
-
Jun 27, 2004, 10:12 #56
- Join Date
- Jan 2004
- Location
- Planet Earth
- Posts
- 1,764
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 27, 2004, 11:44 #57
- Join Date
- Aug 2000
- Location
- Bay Area, CA; (Pasadena, CA this fall)
- Posts
- 61
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
McGruff, what is the downside to this process? Nothing really... just extra deployment effort. Now, if we can find some other minor things to marginally improve the code, we might be able to keep the current shared host (which we might do for lots of reason such as cost).
-
Jun 27, 2004, 11:45 #58
- Join Date
- Jun 2004
- Location
- California
- Posts
- 440
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
A new version was released of this allowing encoding of the freelock include... I just noticed this on the sf.net site.
-
Jun 27, 2004, 11:52 #59
- Join Date
- Sep 2003
- Location
- Glasgow
- Posts
- 1,690
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by webhappy
Bookmarks