From: Josh Cheek Date: 2012-02-03T10:36:11+09:00 Subject: Re: Basic Ruby performance --0016e6de00ec4a78a004b8055606 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Feb 2, 2012 at 7:01 PM, Ryan Davis wrote: > > 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. > > Wow, I never knew that. I don't understand how it accomplishes this, a could be any kind of object with =~ defined anywhere on it, how can it bypass method dispatch? > IMHO re.match is just as useless as Regexp.new, Array.new, and Hash.new > (assuming no args/blocks passed). I usually use `meth Hash.new` instead of `meth({})` I think it looks cleaner. --0016e6de00ec4a78a004b8055606--