Skip to content

Reducing load times of gitlab-com/operations#42

I measured gitlab-com/operations#42 (closed) directly with ruby-prof, and this is what I see:

  • 28% of the time spent ProjectTeam#human_max_access (reduced via !4982 (merged))
  • 18% of the time spent Note#cross_reference_not_visible_for (fixed via !5070 (merged))?
  • 14% of the time spent on rendering the sidebar (Participable#raw_participants)
  • 7% of the time spent on rendering HAML
  • 2% of the time spent on NotesHelper#note_editable?
  • 1% of the time spent on Project#namespace

image

Project#human_max_access is incredibly inefficient:

image

I think we could get some big wins by simply substituting Ability.users_that_can_read_project here.

Methodology for testing:

$: << '/home/stanhu/gems/ruby-prof-0.15.9/lib' # not needed for later GitLab versions
   
require 'ruby-prof'

RubyProf.start
app.get 'https://gitlab.com/gitlab-com/operations/issues/42'

result = RubyProf.stop
printer = RubyProf::CallStackPrinter.new(result)
file = File.open('/tmp/canon.html', 'w')
printer.print(file)
file.close

canon.zip