On Sun, Feb 12, 2012 at 4:12 AM, Xavier Noria <[email protected]> wrote:

Nowadays long strings get a performance boost. That does not make sense
> statistically speaking, English words should be the fast ones.
>

Indeed, running the benchmark against /usr/share/dict/words gives an
overall speedup of more than 7x:

    https://gist.github.com/1806049

The bigger the sample the greater the speedup because inflections are the
exception. The majority of words are inflected using the last rule, so the
difference in the technique to loop is bigger.

This should happen also in real life, the exceptions are rare, in general
most words will be applying the last rule.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to