Script Execution Speed

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Thu Jul 07, 2005 8:45 pm    Post subject: Script Execution Speed Reply with quote

Is there any way to speed up the execution of PHP scripts on my computer?All the scripts I host on my computer run slowly, yet the ones on other site run very swiftly.
Back to top View user's profile Send private message Send e-mail
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Thu Jul 07, 2005 8:46 pm    Post subject: Reply with quote

Get a better computer ;) The faster the cpu, the faster the script.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Thu Jul 07, 2005 8:51 pm    Post subject: Reply with quote

You can also try to tidy up the code of the script, assuming you have a basic understanding of it.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Thu Jul 07, 2005 9:22 pm    Post subject: Reply with quote

I have a VERY FAST cpu.
Back to top View user's profile Send private message Send e-mail
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Thu Jul 07, 2005 10:25 pm    Post subject: Reply with quote

Do a search for gzip on this forum.
Back to top View user's profile Send private message Visit poster's website
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Fri Jul 08, 2005 9:09 am    Post subject: Reply with quote

p3 wrote:
I have a VERY FAST cpu.


1.5ghz is not VERY FAST anymore. Welcome to 2005.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jul 08, 2005 9:12 am    Post subject: Reply with quote

The AbyssUnderground.co.uk forums has a Gzip Compression method.

Sincerely , TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Fri Jul 08, 2005 10:06 am    Post subject: Reply with quote

Your computer must be laced with spyware then as my server is 1.3GHz Duron and it performs perfectly well, even TRUSTpunk only has 366Mhz of processing power and even the most extreame scripts are easy for it.

Try formatting your PC and/or getting a decent pc to begin with.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Fri Jul 08, 2005 3:27 pm    Post subject: Reply with quote

The Inquisitor wrote:
Try formatting your PC and/or getting a decent pc to begin with.


Sounds fun.
Try gzipping your scripts and make sure you have no heavily cpu demanding programs running.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Fri Jul 08, 2005 4:00 pm    Post subject: Reply with quote

How about a link???

Sounds like a good idea, but I just get a bunch of different programs called gzip if I Google it!!!!
Back to top View user's profile Send private message Send e-mail
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Fri Jul 08, 2005 4:13 pm    Post subject: Reply with quote

PhpBB Gzip Header:
Code:
   $phpver = phpversion();

   $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

   if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
   {
       if ( extension_loaded('zlib') )
       {
           ob_start('ob_gzhandler');
       }
   }
   else if ( $phpver > '4.0' )
   {
       if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
       {
           if ( extension_loaded('zlib') )
           {
               $do_gzip_compress = TRUE;
               ob_start();
               ob_implicit_flush(0);

               header('Content-Encoding: gzip');
           }
       }
   }


PhpBB Gzip Footer:
Code:
if ( $do_gzip_compress )
{
   //
   // Borrowed from php.net!
   //
   $gzip_contents = ob_get_contents();
   ob_end_clean();

   $gzip_size = strlen($gzip_contents);
   $gzip_crc = crc32($gzip_contents);

   $gzip_contents = gzcompress($gzip_contents, 9);
   $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

   echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
   echo $gzip_contents;
   echo pack('V', $gzip_crc);
   echo pack('V', $gzip_size);
}

exit;


At least I think that examples from phpbb. On php5 its as simple as inserting 1 line, but I dont know what version you have, so use that.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Fri Jul 08, 2005 5:04 pm    Post subject: Reply with quote

MonkeyNation wrote:
PhpBB Gzip Header:
Code:
   $phpver = phpversion();

   $useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

   if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
   {
       if ( extension_loaded('zlib') )
       {
           ob_start('ob_gzhandler');
       }
   }
   else if ( $phpver > '4.0' )
   {
       if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
       {
           if ( extension_loaded('zlib') )
           {
               $do_gzip_compress = TRUE;
               ob_start();
               ob_implicit_flush(0);

               header('Content-Encoding: gzip');
           }
       }
   }


PhpBB Gzip Footer:
Code:
if ( $do_gzip_compress )
{
   //
   // Borrowed from php.net!
   //
   $gzip_contents = ob_get_contents();
   ob_end_clean();

   $gzip_size = strlen($gzip_contents);
   $gzip_crc = crc32($gzip_contents);

   $gzip_contents = gzcompress($gzip_contents, 9);
   $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

   echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
   echo $gzip_contents;
   echo pack('V', $gzip_crc);
   echo pack('V', $gzip_size);
}

exit;


At least I think that examples from phpbb. On php5 its as simple as inserting 1 line, but I dont know what version you have, so use that.


I use php 5
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Jul 08, 2005 7:50 pm    Post subject: Reply with quote

p3 wrote:
How about a link???

Sounds like a good idea, but I just get a bunch of different programs called gzip if I Google it!!!!


If you would have read my reply , I told you where to go in order to find the
Gzip method , all you had to do was search the AbyssUnderground.co.uk. :/

http://www.abyssunderground.co.uk/forum/viewtopic.php?t=17

Sincerely , TRUSTpunk
Back to top View user's profile Send private message Visit poster's website
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Fri Jul 08, 2005 8:16 pm    Post subject: Reply with quote

TRUSTpunk wrote:
If you would have read my reply , I told you where to go in order to find the
Gzip method , all you had to do was search the AbyssUnderground.co.uk. :/

http://www.abyssunderground.co.uk/forum/viewtopic.php?t=17

Sincerely , TRUSTpunk

...which is the same one you posted on THIS forum.
http://www.aprelium.com/forum/viewtopic.php?t=6686
Back to top View user's profile Send private message Visit poster's website
p3
-


Joined: 17 Jun 2005
Posts: 615

PostPosted: Fri Jul 08, 2005 9:31 pm    Post subject: Reply with quote

That didn't help at all :(
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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


Powered by phpBB phpBB Group