diff options
author | Robert Speicher <robert@gitlab.com> | 2016-06-29 21:34:46 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-06-29 21:34:46 +0000 |
commit | eae5f8aa57d61ce17f6b4885b8da463d1d33e971 (patch) | |
tree | f86abf947b6279ab60f67b6cc570c2470b787aa9 /app/views | |
parent | 47648a50d7bfab644de96025a3001a666cfe7653 (diff) | |
parent | 20688cdf0711f0d7d70abdf01db5a4f3a0671c6c (diff) | |
download | gitlab-ce-eae5f8aa57d61ce17f6b4885b8da463d1d33e971.tar.gz |
Merge branch 'cache-max-user-access-name' into 'master'
Memoize the maximum access level for the author of notes
Cache the maximum access level for each user in a map in the controller
In #19273, we saw that retrieving ProjectTeam#human_max_access for each note takes the bulk of the time when rendering certain issues or merge requests. We observe that most of the comments in an issue are typically done by the same users. This MR memoizes the max access level by user ID.
See merge request !4982
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/notes/_note.html.haml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index a5e163b91e9..af0046886fb 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -17,7 +17,7 @@ %a{ href: "##{dom_id(note)}" } = time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago') .note-actions - - access = note.project.team.human_max_access(note.author.id) + - access = note_max_access_for_user(note) - if access and not note.system %span.note-role.hidden-xs= access - if current_user and not note.system |