From: Michael Fellinger Date: 2010-06-25T02:16:20+09:00 Subject: Re: Count substrings in string, scan too slow On Fri, Jun 25, 2010 at 1:35 AM, botp wrote: > On Fri, Jun 25, 2010 at 12:05 AM, Robert Klemme > wrote: >> http://gist.github.com/451622 >> I would have expected regexp to be faster... > > you don't like strscan ? :) > best regards -botp I've just run some benchmarks with strscan, and it's at least in the same ballpark as the other approaches, unless you're on rubinius, but then all string processing is really slow on that anyway. Benchmark with strscan here: http://gist.github.com/451675 -- Michael Fellinger CTO, The Rubyists, LLC