aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/request_test.rb
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2015-07-24 22:25:41 -0500
committerschneems <richard.schneeman@gmail.com>2015-07-29 20:41:57 -0500
commit1bf50badd943e684a56a03392ef0ddafefca0ad7 (patch)
tree7d5fd2f8f2d2a3dfc7271fd8ff213d16e99a1686 /actionpack/test/dispatch/request_test.rb
parentf80aa5994603e684e3fecd3f53bfbf242c73a107 (diff)
downloadrails-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/test/dispatch/request_test.rb')
0 files changed, 0 insertions, 0 deletions