Optimize PHP, Part 1
View days ago i am searching solutions for any tips and tricks about
best practice to optimize PHP code performances and i found some of
useful articles which you may interested with. some of article resume
- echo is faster than print.(* compare with list from phplens by John Lim)
- Use full paths in includes and requires, less time spent on resolving the OS paths.
- Unset your variables to free memory, especially large arrays.
- Set the maxvalue for your for-loops before and not in the loop.
- str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4
- Error suppression with @ is very slow.
- Turn on apache’s mod_deflate
- Close your database connections when you’re done with them
- $row[’id’] is 7 times faster than $row[id]
- If you need to find out the time when the script started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()
Thank you for reading this post. You can now Leave A Comment (0) or Leave A Trackback.
Post Info
This entry was posted on Wednesday, September 24th, 2008 and is filed under PHP.You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.
Previous Post: Buku Sekolah Elektronik, Versi Gratis Buku Sekolah Berstandar »
Next Post: susu tercemar melamin berbahaya »
Latest Posts:
- Seri Tutorial membuat template wordpress,Struktur Template wordpres
- susu tercemar melamin berbahaya
- Optimize PHP, Part 1
- Buku Sekolah Elektronik, Versi Gratis Buku Sekolah Berstandar
- Beberapa langkah untuk Mempercepat Windows XP Anda
- Download Banyak File bersamaan dengan Wget dan Rapidshare Premium
- Marhaban ya ramadan, Jadwal Imsakiyah Ramadhan 1429 H 2008
- Mikrotik Hotspot tanpa username dan password
- MySQL Client does not support authentication protocol
- Page Break dengan CSS



