ALL
What have been Facebook’s greatest technical accomplishments?
To maintain a large website which gets billions of requests er day and keeps very fast response speed is not an easy task. Many big companies are trying best to improve user experience by adopting different techniques. There is a question on Quora which asks "What have been Facebook’s greatest technical accomplishments?". There is a person who worked in Facebook before provided an answer which helps us understanding how Facebook handles huge amount of traffic each day.Here is the answer from Robert Johnson.I ran the infrastructure software team at facebook for five years, and was in...
2,189 0 FACEBOOK EFFICIENCY DESIGN
Tips for improving PHP efficiency
0. Using single quote to replace double quote to enclose string literal, this will be a bit faster. Because PHP engine will search variables in double quoted string.1. If a method in class can be declared as static, then make it static, this will be 4 times faster.2. $row["id"] is 7 times faster than $row[id]3. echo is faster than print, and you should use multiple parameters instead of string concatenation, i.e use comma(,) instead of dot(.) to concatenate string. For example echo $str1,$str24. Calculate the numer of loops before executing for loop, don;t calculate the number of loops in each...
15,169 0 PHP EFFICIENCY TIPS
Efficiency of code execution
If you want to optimize your program codes, you need to find their Hotspot, i.e, the codes which are executed most frequently. If you can optimize this portion of codes a bit, you may gain much improvement of your code efficiency. Here I give you three examples about efficiency of code execution.1. PHP's Getter and Setter (From Reddit)This example a quite simple, you can skip it if you want.Consider the code below, we can find it's slower when we use Getter/Setter method to read a member variable rather than read/write member variables directly.<?php //dog_naive.php &...
4,498 0 CODE ANALYSIS TRICK EFFICIENCY