smp_86112
Feb 02, 2010Cirrostratus
Efficiency of String Comparison
Which statement is more efficent in terms of processing?
[HTTP::uri] equals "/"
or
[HTTP::uri] == "/"
According to my interpretation of the official TCL doc, "equals" assumes the right side is already a string. On the other hand, "==" seems to assume the right side is a number. From the "==" description...
(i.e., numeric comparison if possible, exact string comparison otherwise).
So my conclusion is that "equals" is more efficent because the TCL engine does not have that extra decision to make.
I am just looking for a sanity check. I realize this is pretty meaningless in the context of a single rule, but we have this problem in many iRules - I'm looking for places to optimize. Thanks for your input.