Optimise upload path calls
What does this MR do?
String#underscore
isn't particularly slow, but it's possible for us to
call it many times in a users autocomplete request, with mostly-static
values ('User', 'Group', etc.). We can memoise this and save a
surprising amount of time (around 10% of the total request time in some
cases).
See https://gitlab.com/gitlab-org/gitlab-ce/issues/60903#note_168567352.
Does this MR meet the acceptance criteria?
Conformity
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.