diff options
author | schneems <richard.schneeman@gmail.com> | 2015-07-24 22:25:41 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2015-07-29 20:41:57 -0500 |
commit | 1bf50badd943e684a56a03392ef0ddafefca0ad7 (patch) | |
tree | 7d5fd2f8f2d2a3dfc7271fd8ff213d16e99a1686 /actionpack/lib/action_controller/metal/rack_delegation.rb | |
parent | f80aa5994603e684e3fecd3f53bfbf242c73a107 (diff) | |
download | rails-1bf50badd943e684a56a03392ef0ddafefca0ad7.tar.gz rails-1bf50badd943e684a56a03392ef0ddafefca0ad7.tar.bz2 rails-1bf50badd943e684a56a03392ef0ddafefca0ad7.zip |
Decrease string allocations in apply_inflections
In `apply_inflections` a string is down cased and some whitespace stripped in the front (which allocate strings). This would normally be fine, however `uncountables` is a fairly small array (10 elements out of the box) and this method gets called a TON. Instead we can keep an array of valid regexes for each uncountable so we don't have to allocate new strings.
This change buys us 325,106 bytes of memory and 3,251 fewer objects per request.
Diffstat (limited to 'actionpack/lib/action_controller/metal/rack_delegation.rb')
0 files changed, 0 insertions, 0 deletions