Forum Discussion
JRahm
Admin
Jun 20, 2011Just a note on optimizations...I was curious about the efficiency of $static::debug != 0 versus $static::debug == 1 versus just $static::debug...here's how it worked out in my testing:
1. 37166 cycles on average over 5000 requests from (ab -n 5000 -c 25 http://172.16.101.85/)
if { $static::debug != 0 } {}
2. 34341 cycles on average over 5000 requests from (ab -n 5000 -c 25 http://172.16.101.85/) if { $static::debug == 1 } {} 3. 29034 cycles on average over 5000 requests from (ab -n 5000 -c 25 http://172.16.101.85/):
if { $static::debug } {}
A 21.9% savings by using the 3rd option as opposed to the 1st!