Code optimizations in PHP
Calculation times and memory usage
v1 | v2 | v3 | v4 | v5 | v6 | |
---|---|---|---|---|---|---|
? guests / 1 sec | 18 | 44 | 47 | 92 | 97 | 98 |
? guests / 30 sec | 23 | 76 | 79 | -1 | -1 | 222 |
? sec / 25 guests | 86,062 | 0,046 | 0,0312 | 0,0052 | 0,0052 | 0,0062 |
? guests / 128MB | -3 | -3 | -3 | 122 | 122 | 257 |
1 – code eats up all memory before the measuring point
2 – fluctuates because of the measuring inaccuracies, code speed cannot be determined correctly for 25 guests
3 – code does not reach memory limit in the 90 second timespan
Results in the 1 second runtime
Data is only painted where the runtime fits in 1 second. Two graphs are best shown under another, because where the runtime reaches 1 second the memory graph also gets broken, signalling that the version cannot calculate for more guests.
Running in the original limits
Tracking monthly expenses 3.0 MAC-based exception in a Mikrotik hotspot