diff options
author | Sam <sam.saffron@gmail.com> | 2018-02-16 13:32:31 +1100 |
---|---|---|
committer | Sam <sam.saffron@gmail.com> | 2018-02-16 13:32:31 +1100 |
commit | 98d4fc3e82ebfd535b05b7f6e3abb4b03595c2dd (patch) | |
tree | 2875cc98acac9e6825e3fe5223d603c7fabd7683 | |
parent | 23c5558f37c2c55807e7603415214f2b4b7b22c1 (diff) | |
download | rails-98d4fc3e82ebfd535b05b7f6e3abb4b03595c2dd.tar.gz rails-98d4fc3e82ebfd535b05b7f6e3abb4b03595c2dd.tar.bz2 rails-98d4fc3e82ebfd535b05b7f6e3abb4b03595c2dd.zip |
PERF: reduce retained objects in Journey
Before:
Total allocated: 209050523 bytes (2219202 objects)
Total retained: 36580305 bytes (323462 objects)
After:
Total allocated: 209180253 bytes (2222455 objects)
Total retained: 36515599 bytes (321850 objects)
---
Modest saving of 1612 RVALUEs in the heap on Discourse boot
The larger the route file the better the results.
Saving will only be visible on Ruby 2.5 and up.
-rw-r--r-- | actionpack/lib/action_dispatch/journey/nodes/node.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/journey/nodes/node.rb b/actionpack/lib/action_dispatch/journey/nodes/node.rb index 08b931a3cd..6f12052713 100644 --- a/actionpack/lib/action_dispatch/journey/nodes/node.rb +++ b/actionpack/lib/action_dispatch/journey/nodes/node.rb @@ -32,7 +32,7 @@ module ActionDispatch end def name - left.tr "*:".freeze, "".freeze + -(left.tr "*:", "") end def type @@ -82,7 +82,7 @@ module ActionDispatch def initialize(left) super @regexp = DEFAULT_EXP - @name = left.tr "*:".freeze, "".freeze + @name = -(left.tr "*:", "") end def default_regexp? |