1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/lib
schneems 99d260298c Move digest path calculation out of loop
On every iteration of generating a cache for a collection a “digest path” is calculated even though it’s exactly the same for every element.

This PR exposes a method `digest_path_from_virtual` that returns back a “digest_path”. This can in turn be passed back into `cache_fragment_name`. This not only does less work, but it also (you guessed it) uses  less memory.

before: Total allocated: 762539 bytes (7035 objects)
after: Total allocated: 743590 bytes (6621 objects) 


(762539 - 743590)/ 762539.0 # => 2.4% faster 
2018-09-11 16:52:44 -05:00
..
action_view Move digest path calculation out of loop 2018-09-11 16:52:44 -05:00
action_view.rb Bump license years for 2018 2017-12-31 22:36:55 +09:00