BigW Consortium Gitlab
Optimize cross ref system notes check ## What does this MR do? This MR optimizes system note visibility checking by memoizing the visible reference count, reducing the overhead of calling `Note#cross_reference_not_visible_for?`. ## Are there points in the code the reviewer needs to double check? Note that since a cross reference message contains, "Mentioned in XYZ", we EXPECT that there is at least one reference. That's why using the ref count > 0 works. ## Why was this MR needed? The previous implementation relied on `Note#cross_reference_not_visible_for?`, which essentially tries to render all the Markdown references in a system note and only displays the note if the user can see the referring project. But this duplicated the work that Banzai::NotesRenderer was doing already. This shaves about 0.8 s from the load time from https://gitlab.com/gitlab-com/operations/issues/42. ## What are the relevant issue numbers? #19273 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5070
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
config | Loading commit data... | |
controllers | Loading commit data... | |
factories | Loading commit data... | |
features | Loading commit data... | |
finders | Loading commit data... | |
fixtures | Loading commit data... | |
helpers | Loading commit data... | |
initializers | Loading commit data... | |
javascripts | Loading commit data... | |
lib | Loading commit data... | |
mailers | Loading commit data... | |
models | Loading commit data... | |
requests | Loading commit data... | |
routing | Loading commit data... | |
services | Loading commit data... | |
support | Loading commit data... | |
tasks/gitlab | Loading commit data... | |
views | Loading commit data... | |
workers | Loading commit data... | |
factories_spec.rb | Loading commit data... | |
rails_helper.rb | Loading commit data... | |
spec_helper.rb | Loading commit data... | |
teaspoon_env.rb | Loading commit data... |