Forum Discussion
Heisenberg_1452
Feb 28, 2014Historic F5 Account
string equal/compare/match vs. switch
All,
Very new to iRules. Wondering if anyone knows what is more efficient:
switch $foo {
"bar" {...}
"bar1" {...}
"bar2" {...}
default {...}
}
vs.
if {string e...
IheartF5_45022
Nacreous
Feb 28, 2014switch is more efficient for more than 4 or 5 elseif I believe.
I tend to use switch for anymore than 1 as I like the format better, even though it's slightly less efficient. This might be useful https://devcentral.f5.com/articles/irules-optimization-101-01-if-elseif-and-switch.UxAwSEq4aM8
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects