GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 04-Mar-2003, 19:13
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough

Optimising PHP


Okay as a relative newbie I didn't understand this fairly lengthy read but people who are in charge of a server may find it very interesting.

http://phplens.com/lens/php-book/opt...ugging-php.php
  #2  
Old 05-Mar-2003, 09:11
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
For a relative newbie to PHP, this article is overkill.

Also, unless you're seriously into web developing and manage your own server, this article's server tweaks and optimisation tips is lost on the average webmaster who hosts his/her site on Virtual / Shared Web Hosting plans.

The article is informative, there is absolutely no doubt about it - I think it answered one question I have been asking myself recently:

Quote:
Unset() variables that are not used anymore to reduce memory usage. This is mostly useful for resources and large arrays.

... I am glad I went with my instincts.
  #3  
Old 08-Mar-2003, 13:21
Elmseeker's Avatar
Elmseeker Elmseeker is offline
Junior Member
 
Join Date: Jan 2003
Posts: 87
Elmseeker is on a distinguished road
Well...unset() is all but useless nowadays anyways unless you want to reuse an array or variable and you need to make absolutely sure that the old one is removed from memory...unset() is automatically called at script ermination in any case so you almost never really need to call it explicitly. One good use for unset(), however, is to use it as part of a "logout" script in conjunction with session_destroy() this way when a user is logged in to a site their info stays with them but when they log out or time out you can session_destroy() and unset all of their info to make sure they are completely logged out and could even use this to change the users $SID....just a thought...personally I never use it as I don't have any arrays that are load intensive enough to worry about it...which is the other use of unset() simply calling it to destroy arrays or parts of arrays that are no longer being used in really large chunks of code...of course if your chunks are large enough to NEED to be unset you should probably look for a faster, cleaner, smaller way of writing the code...I can't personally think of anything you would want to code that you would HAVE to use unset() in order to help optimize the code for speed as just about anything you can do with alot of code can be done with a little code as well if you take the time to do a little research...I have over the years learned how to do things in many programming languages including C, C++, PHP, PERL...things that used to take me 100 lines of code and alot of CPU cycles to do I can now quite often do in 10-20 lines of code with alot less CPU usage...Anyway, someone else needs the computer here in the library now (they only have 3) so I will be going and will try to be back on for a little while monday to see that everything is going ok. Have fun all, Thanks again for all your help RL as well as OL J...

Elmseeker
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing your web server with Turck MMCache for PHP JdS Web Hosting Forum 2 07-Jan-2004 08:48
apache2 - php cgi fehler - schleife inna Apache Web Server Forum 8 27-Nov-2003 10:55
Automate a data change php form mjfmn MySQL / PHP Forum 4 20-Oct-2003 10:37
[Linux] Installing PHP --with-mcrypt JdS Web Hosting Forum 0 20-Aug-2003 09:40
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 17:14

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:26.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.