Maugrim the Reaper’s recent article on PHP Optimisation discusses using Xdebug profiling to increase script performance. On Windows, WinCacheGrind can be used to see the profiler output.
In my code, the only problem area is the Solar Empire universe generator. I expect this is caused by recursive function calls and nested loops.
How expensive are hash functions?
| Hash method | 100000 iterations /ms | Average /µs |
|---|---|---|
| md5 | 599 | 5.99 |
| sha1 | 730 | 7.30 |
| crc32 | 116 | 1.16 |
I want to use crc32 to store the user-agent inside the session row (integer column). This will increase session security without a large space cost.

Comments