Default view for a file should be its content

Bug #568148 reported by Ian Clatworthy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
loggerhead
Fix Released
High
Max Kanat-Alexander

Bug Description

Analysing the codebrowse logs for Launchpad (https://lists.ubuntu.com/archives/bazaar/2010q2/068266.html) shows that we're displaying the annotated view of a file regularly: 20-25% normally and 75+% under "peak" conditions, e.g. when an interesting file URL appears on a popular site. We don't really need to calculate that annotated data so frequently: showing the file content - with a separate link to get to the annotated data - would be fine.

Tags: performance

Related branches

Revision history for this message
Robert Collins (lifeless) wrote :

This should be pretty trivial really.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I have a branch which does some of this -- lp:~mwhudson/loggerhead/browse-tree -- but sadly it also tries to combine the current files/ and annotate/ urls into a single browse/ url and that bit is pretty horrible. But maybe it'll be useful to someone.

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

Okay, I've started to do some work on this--so far it doesn't look too hard, and in my brief testing on my local machine, it makes a reasonably-sized annotate take .3 seconds instead of 1.1 seconds, so I'd guess we'd save a significant percentage of the total CPU time being used on codebrowse by this.

I am also tempted to do what mwhudson did, and change the URLs at the same time, but for now I will focus just on making it not annotate.

I think there are other optimizations that can be done to the annotate controller after this bug, as well. (In particular, do we really have to get an entire inventory just so that we can get the file content and its name [not even its path]?)

Changed in loggerhead:
assignee: nobody → Max Kanat-Alexander (mkanat)
status: Confirmed → In Progress
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 568148] Re: Default view for a file should be its content

A few thoughts.

Annotation is nice when wanted, lets make sure there is a way to do
that. Perhaps as a later iteration.

Inventories are not big - they are in 2a 2 UUIDS long (and thus
cheap). Iterating an entire inventory is a tree walk in the CHK store,
so can be slower. Looking up a patch is a path walk in the (parent,
basename) tuple hashmap for the inventory, so quite cheap.

-Rob

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

Hey Robert. Yes, of course, there will still be a way to do annotation, as a part of this bug.

When it comes to any other optimizations, I'm sure we can discuss them when the time comes.

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

I've fixed this. See the MP for more details.

One of the other advantages of this patch is that the annotate view now actually renders progressively, instead of doing all of the annotation and *then* rendering the page.

Changed in loggerhead:
status: In Progress → Fix Committed
Changed in loggerhead:
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.