OK, the alternation is a red herring.
I have a patch with the new approach implemented and have compared
runtimes: no difference, there's no speedup.
The 6x speedup in the proof of concept happens because the script is
not doing this apparently innocent check over the default 9
uncountable words:
inflections.uncountables.any? { |inflection| result =~
/\b#{inflection}\Z/i }
which is present in ActiveSupport::Inflections#apply_inflections.
In that method, if you return the inflection right way instead of
doing this check, you see the 6x.
--
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.