summaryrefslogtreecommitdiff
path: root/spec/requests/api/notification_settings_spec.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-04-23 22:32:50 -0700
committerStan Hu <stanhu@gmail.com>2017-04-24 06:43:24 -0700
commita0edaa9210642f23ef3ea4984c6d6f77cbbba878 (patch)
tree5c5eccfe23aaad3a1427fd7e9bd5992f44e98ac1 /spec/requests/api/notification_settings_spec.rb
parent1005389f70070245092c1ae5f3f9b10b8e7c102e (diff)
downloadgitlab-ce-a0edaa9210642f23ef3ea4984c6d6f77cbbba878.tar.gz
Cache Routable#full_path in RequestStore to reduce duplicate route loadssh-optimize-duplicate-routable-full-path
We see in #27387 that a call to `polymorphic_path` will cause duplicate SELECT route calls for each merge request in a milestone. This happens because calling `project.namespace.becomes(Namespace)` will instantiate a new instance of a Namespace for each merge request, which causes a N+1 query on the routes table. This change caches the state of the route by the specific class and ID, which dramatically eliminates duplicate work.
Diffstat (limited to 'spec/requests/api/notification_settings_spec.rb')
0 files changed, 0 insertions, 0 deletions