Static regexps

Static regexps


Hi
I've been seeing the multiple commits for http://dev.jquery.com/ticket/4111.
Moving regexps to local vars to cache them.
I was wondering if this is a perfomance measure and if so, if there's
some benchmark out there to prove the gain.
I personally think these changes make the code more complicated and
longer. I'd rather see the regexp in place if I want to understand
what it does.
I went ahead and created a benchmark for this:
http://benchmarker.flesler.com/regexp/run/
The conclusions were that there's absolutely no gain in speed except
on IE. Even on IE, it doesn't seem to be such a critic improvement and
it's slower the more you get away from the variables' scope chain (in
nested functions).
Any opinion ?
Cheers
--
Ariel Flesler