Menu performance fix - only render required links

Bug #659171 reported by Ian Booth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Ian Booth

Bug Description

When rendering pages/views, there are performance issues in the way menus are handled. Two relevant examples:

1. Many templates define an instance of a menu at the start of the markup to avoid the cost of duplicate instances, but we know that the menu will be reinstantiated in a portlet. Creating reusable markup often means death by menu queries

2. canonical.launchpad.webapp.MenuBase class eagerly iterates over all menu links during setup (and hence executes all required underlying database queries to construct the link) even if the links are not actually rendered.

A performance oops illustrating a concrete impact of this problem:

OOPS-1737M2079 Person:+subscribedbranches

One fix is to modify menu infrastructure so that only the menu links are only instantiated as required by the page template. This solves the major performance issue and means the impact of creating the same menu instances more than once are eliminated for all practical purposes.

Related branches

Ian Booth (wallyworld)
Changed in launchpad:
status: New → In Progress
Curtis Hovey (sinzui)
affects: launchpad → launchpad-foundations
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
Changed in launchpad-foundations:
milestone: none → 10.11
tags: added: qa-needstesting
Changed in launchpad-foundations:
status: In Progress → Fix Committed
Ian Booth (wallyworld)
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.