From: John Carter Date: 2005-12-21T12:15:27+09:00 Subject: Re: =~ vs match - Some benchmarks. On Wed, 21 Dec 2005, 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... >> > Huh. Interesting. Why is > string=~/frogs/o > faster than: > string=~/frogs/ > ..when there are no substitutions involved? I suspect they are the same to within the experimental error. ie. No difference. John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand Carter's Clarification of Murphy's Law. "Things only ever go right so that they may go more spectacularly wrong later." From this principle, all of life and physics may be deduced.