Split intraline differences into their own cache

The bulk of the running time for loading a PatchList entry from the
PatchListCache is actually within the intraline difference code.
Assuming no bugs, running JGit's DiffFormatter and converting the
results is typically sub-second, even for a very large change that
has renames.

By deferring the intraline difference logic until its actually
required to display a particular file allows file lists to load
very quickly, and doesn't penalize users who have disabled the
intraline difference setting in their account preferences.

This also offers a work around for the dreaded "patch of death"
situation.  When a bad file is encountered and it won't load,
users can temporarily switch off intraline difference and open the
file anyway.  Unfortunately the server will still have at least
one worker thread stuck generating the intraline difference cache
record, but at least the change is still viewable.

Change-Id: I61bbd3d068bd9b3da9d1018c0f66969a5b6ff58e
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-11-11 16:54:35 -08:00
parent a3d260a3e1
commit 3ea1d5567c
9 changed files with 371 additions and 169 deletions

View File

@@ -35,7 +35,7 @@ import java.io.Serializable;
import javax.annotation.Nullable;
public class PatchListKey implements Serializable {
static final long serialVersionUID = 15L;
static final long serialVersionUID = 16L;
private transient ObjectId oldId;
private transient ObjectId newId;