View Single Post
Old 03-03-2023, 05:48 AM   #523
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,486
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
When short-circuiting is accounted for, would it maybe be faster to do two separate exact checks:

Code:
($#columnname=='foo'||$#columnname=='bar')
Than one regex match?

Code:
'^(foo|bar)$' in $#columnname
In this case and assuming that the first check is true a reasonable number of times, then yes because the == operator is much faster than the 'in' operator.
chaley is offline   Reply With Quote