Performance

Do: Order Database Table Columns for Performance
In some databases, it is more efficient to order the columns in a specific manner because of the way the disk access is performed. The optimal order of colu...
Thu, 12 Oct, 2017 at 9:01 AM
Do: Return Early
Once the outcome of a PHP method or procedure has been established, it SHOULD be returned. The examples below demonstrate this may save memory and computati...
Thu, 12 Oct, 2017 at 9:02 AM
Do: Store DateTimes as UTC Timestamps
Times and dates with times SHOULD be stored in Coordinated Universal Time (UTC). Incorrect: `date_added` DATETIME NOT NULL Correct: `date_added` T...
Thu, 12 Oct, 2017 at 9:05 AM
Do: Your Own Math
Letting the server recalculate a fixed value over and over again, is lazy. Simply calculate the fixed value once yourself. Add a comment if you would like t...
Thu, 12 Oct, 2017 at 9:14 AM
Don’t: Cast MySQL Integers to Strings
String equality comparisons are much more expensive than integer compares. If a database value is an integer, it MUST NOT be treated as a numeric string. Th...
Thu, 12 Oct, 2017 at 9:26 AM
Don’t: Close and Immediately Re-Open PHP Tags
Incorrect: <?php echo $header; ?><?php echo $menu; ?> Incorrect: <?php echo $header; ?> <?php echo $menu; ?> Correct: ...
Thu, 12 Oct, 2017 at 9:30 AM