View Single Post
Old 12-13-2007, 03:16 PM   #7 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Same here, formatted my own list. Some things I don't agree with, and the others I don't understand.

I do not agree with;
1. If a method can be static, declare it static. Speed improvement is by a factor of 4;

I do not understand these points;
7. require_once() is expensive;
15. Turn on apache's mod_deflate.

And these I will use for sure;
10. See if you can use strncasecmp, strpbrk and stripos instead of regex;
14. Error suppression with @ is very slow;
17. $row[’id’] is 7 times faster than $row[id];
18. Error messages are expensive;
19. Do not use functions inside of for loop, such as for ($x=0; $x < count($array); $x) The count() function gets called each time;
30. A PHP script will be served at least 2-10 times slower than a static HTML page by Apache. Try to use more static HTML pages and fewer scripts. (did know it, now I understand why);
31. Your PHP scripts are recompiled every time unless the scripts are cached. Install a PHP caching product to typically increase performance by 25-100% by removing compile times (like which program?);
32. Cache as much as possible. Use memcached - memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. OP code caches are useful so that your script does not have to be compiled on every request;
33.
PHP Code:
if (strlen($foo) < 5) { echo "Foo is too short"; }
vs.
if (!isset(
$foo{5})) { echo "Foo is too short"; } 
Not everything has to be OOP, often it is too much overhead, each method and object call consumes a lot of memory.
I LOVE YOU.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote