String#=~ faster than String#match by schneems · Pull Request #59 · fastruby/fast-ruby
Navigation Menu
- Notifications You must be signed in to change notification settings
- Fork 375
Conversation
schneems referenced this pull request in schneems/rails
Aug 6, 2015In `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.
JuanitoFatas added a commit that referenced this pull request
Aug 7, 2015This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters