Forum Discussion
equals vs eq?
You could run a test with two irules using each and checking the timing in the "tmsh show ltm rule" command. Hit each irule with apache bench 100k times and see what the timing looks like.
I would venture a guess that since they're both string comparison operators, they probably use the same code under the hood. "==" should be less efficient for strings since it has to deal with integers as well. Unless the iRule devs found some giant inefficiency within the TCL eq operator (Unlikely), it's probably just to make a more readable iRule.
- jaikumar_f5Feb 03, 2019
Noctilucent
As said by Dave, it is also my understanding that equal and eq are same. They are string operator. The comparison should be eq with ==. As == is a numeric operator. So when you compare using "eq" or "equal", there will be less cycle time, as it would treat both values as strings. But if compare using "=", there will be higher cycle time, as tcl would convert each string to integer.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
