From: Bill Guindon Date: 2005-12-21T09:42:06+09:00 Subject: Re: =~ vs match - Some benchmarks. On 12/20/05, Wilson Bilkovich wrote: > On 12/20/05, John Carter wrote: > > While profiling some code I noticed =~, String.match and Regexp.match > > turning up in my hotspots. So here is the results of a little > > benchmarking to resolve which is faster to use... > > Thanks for running these, and posting them. Wonder if there shouldn't be a wiki section for benchmarks. > Huh. Interesting. Why is > string=~/frogs/o > faster than: > string=~/frogs/ > ..when there are no substitutions involved? > Purely a guess... it's not checking to see if any substitution is needed on further runs, where by default, it checks every time. -- Bill Guindon (aka aGorilla)