Skip to content

Optimize maximum user access level lookup in loading of notes

Stan Hu requested to merge stanhu/gitlab-ce:memoize-note-editable into master

What does this MR do?

Optimize maximum user access level of lookup in loading of notes

Are there points in the code the reviewer needs to double check?

Check the permission checks.

Why was this MR needed?

NotesHelper#note_editable? and ProjectTeam#human_max_access currently take about 16% of the load time of an issue page. This MR preloads the maximum access level of users for all notes in issues and merge requests with several queries instead of one per user and caches the result in RequestStore.

What are the relevant issue numbers?

#15670 (moved), #19273 (closed)

Does this MR meet the acceptance criteria?

Merge request reports