diff options
author | schneems <richard.schneeman@gmail.com> | 2015-07-24 22:38:34 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2015-07-29 20:41:57 -0500 |
commit | 9b8258814e695fe7fbb728456498fd0fd8709f5c (patch) | |
tree | 00f25ca7276928946dc7b8cefc8d44f6a974ef92 /actionpack/test/lib | |
parent | 83ee043c6834914607849ae9cd3b9eab6b41702c (diff) | |
download | rails-9b8258814e695fe7fbb728456498fd0fd8709f5c.tar.gz rails-9b8258814e695fe7fbb728456498fd0fd8709f5c.tar.bz2 rails-9b8258814e695fe7fbb728456498fd0fd8709f5c.zip |
Speed up journey extract_parameterized_parts
Micro optimization: `reverse.drop_while` is slower than `reverse_each.drop_while`. This doesn't save any object allocations.
Second, `keys_to_keep` is typically a very small array. The operation `parameterized_parts.keys - keys_to_keep` actually allocates two arrays. It is quicker (I benchmarked) to iterate over each and check inclusion in array manually.
This change buys us 1774 fewer objects per request
Diffstat (limited to 'actionpack/test/lib')
0 files changed, 0 insertions, 0 deletions