From: Ryan Davis Date: 2012-02-03T10:01:40+09:00 Subject: Re: Basic Ruby performance On Feb 2, 2012, at 15:33 , Peter Vandenabeele wrote: > The same "formatted" code with just replacing re.match( s) by > s =~ /test/ also causes the same change from 22 to 7 seconds > on my system (with the same formatting, spaces, etc.). You're replacing a method call (a.match b) with a syntactic construct a =~ b, the latter of which bypasses method dispatch and goes straight to the C-implimentation. Nothing else is really different, just a more direct code path. The match data is still available via the usual globals. IMHO re.match is just as useless as Regexp.new, Array.new, and Hash.new (assuming no args/blocks passed). They're throwbacks to java devs and serve no purpose but to make things more verbose. In this specific case, there are tangible reasons to use =~ over #match.