On 2006-07-28, Eric Hodel <drbrain / segment7.net> wrote:

> =~ with a literal regexp is faster than =~ with anything else, and  
> match is slower than both.
>
> [snip]
> =~ variable   1.750000   0.010000   1.760000 (  1.985988)
> match         4.460000   0.040000   4.500000 (  4.980295)
> [snip] 
> =~ variable   1.760000   0.020000   1.780000 (  3.459860)
> match         4.550000   0.050000   4.600000 (  7.792777)

Yow!  Calling String#match is 2-3 times as slow!  Why is that?  The
overhead of calling the method?

Regards, 

Jeremy Henty