Code review comment for lp:~al-maisan/launchpad/clog-oops-452070

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Hello there!

The branch at hand optimises pages with a long changelog/history like:

    https://launchpad.net/ubuntu/+source/linux/+changelog

These pages time out on a regular basis due to the number of database
queries issued in order to fetch the bugs/persons needed for the so
called "linkification".

You can see what such a page looks like by following the link below
(since it's less prone to time out).

    https://launchpad.net/ubuntu/+source/bash/+changelog

The optimisations introduced are twofold:

  - the numbers of the bugs that appear on the page are all extracted
    and a *single* database query that pre-loads them into the storm
    cache is issued before the linkification starts.
  - Analogously, the email addresses are extracted from the page and an
    email address/person cache is provided to
    FormattersAPI.linkify_email() in order to avoid many/repeated
    database lookups.

Please note that

  - the bulk of the code was merely refactored i.e. most of the private
    `SourcePackageReleaseView` methods have been converted into
    functions so they can be reused.
  - Deryck consented to having the getByNumbers() method added to IBugSet.

Pre-implementation calls with bigjools and jtv.

Tests to run:

    bin/test -v -t xx-distributionsourcepackagerelease-pages.txt -t sourcepackage

More importantly, this branch was tested thoroughly on the Soyuz dogfood
system. The resulting improvements are as follows:

  - the number of database queries was reduced by approx. 66%
  - the overall page loading time was reduced by approx. 33%

« Back to merge proposal