From: Devin Mullins Date: 2006-09-07T14:37:39+09:00 Subject: Re: Benchmarking (Was: Re: Compiling Regexp only once) >> Interesting. Note that this is different from your benchmark in >> ruby-talk:204747, wherein much of the savings seems to come from not >> having to instantiate & populate a MatchData. Compare: > > Vastly different. He's calling scan/split instead of s =~ //. s =~ // > is the fastest way to invoke a match as you avoid the method dispatch > altogether. Hurh? I'll admit up front that I'm absolutely clueless about benchmarking, but didn't my last bench show that most of the savings with s =~ // doesn't have to do with the method dispatch, but with MatchData? (Sadly, in retrospect, it lacked any comparisons of the various ways to *reference* a regex -- literal, constant, etc. -- which was the meat of the bench to which I was responding. Oh well. Sleepyhead..) Devin