Making PHP go faster
Feb. 8th, 2014 07:54 pmThe story so far: trying to make PHP run faster on a ReadyNAS Duo. Now, when it comes to optimising software there's two rules:
1. Don't optimise
2. Don't optimise yet
What this really means is that you shouldn't just blindly attempt to optimise your code without first knowing which parts of it are actually slow. For example, you may have some function that when you look at the source code is obviously very slow, but in practice it may always be called in a way that means it runs quickly (for example, a bubble sort which only ever sorts 3 items). On the other hand, you might have an algorithm that is usually fast but you just happen to use it in such a way that makes it very slow (for example, a hash map where every element has the same hash code).
( Successfully (!) installing Xdebug on a ReadyNAS )
1. Don't optimise
2. Don't optimise yet
What this really means is that you shouldn't just blindly attempt to optimise your code without first knowing which parts of it are actually slow. For example, you may have some function that when you look at the source code is obviously very slow, but in practice it may always be called in a way that means it runs quickly (for example, a bubble sort which only ever sorts 3 items). On the other hand, you might have an algorithm that is usually fast but you just happen to use it in such a way that makes it very slow (for example, a hash map where every element has the same hash code).
( Successfully (!) installing Xdebug on a ReadyNAS )