git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [EGIT PATCH 5/5] Cache resolved ids in quickdiff document for faster update

From
Shawn O. Pearce <spearce@spearce.org>
Date
Apr 5, 2009, 20:36 UTC
Message-ID
<20090405203604.GP23521@spearce.org>
In-Reply-To
<1238697991-12990-6-git-send-email-robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> We do this by caching the commit, tree and blob ids and can then
> very quickly decide whether a change in baseline actually results in a
> changed version of the reference blob used for quickdiff.
...
Show 8 quoted lines
> @@ -31,6 +34,11 @@
>  
>  class GitDocument extends Document implements RepositoryListener {
>  	private final IResource resource;
> +
> +	private AnyObjectId lastCommit;
> +	private AnyObjectId lastTree;
> +	private AnyObjectId lastBlob;
Should have been "ObjectId"; I amended the patch.
> +		Commit baselineCommit = repository.mapCommit(commitId);
> +		Tree baselineTree = baselineCommit.getTree();
> +		TreeEntry blobEntry = baselineTree.findBlobMember(gitPath);
Arrrgh.  We're still using Commit/Tree/TreeEntry to read file paths?

I'm applying this as-is, but we really need to start to transition away from them. I wanted to start deleting the mapCommit and its friends from the Repository class.

-- 
Shawn.
Previous: Robin RosenbergNext: Robin Rosenberg
Message 7 of 11 in “Quickdiff improvements”
  1. 0/5 Quickdiff improvementsRobin Rosenberg, Apr 2, 2009
  2. 1/5 Make the equals method work for AnyObjectId, not just ObjectIdRobin Rosenberg, Apr 2, 2009
  3. 2/5 quickdiff - Don't add GitDocument as repository listener more than onceRobin Rosenberg, Apr 2, 2009
  4. 3/5 Move dcocument to repository mapping to GitDocumentRobin Rosenberg, Apr 2, 2009
  5. 4/5 Update Quickdiff tracing statementsRobin Rosenberg, Apr 2, 2009
  6. 5/5 Cache resolved ids in quickdiff document for faster updateRobin Rosenberg, Apr 2, 2009
  7. Shawn O. PearceApr 5, 2009
  8. Robin RosenbergApr 5, 2009
  9. Shawn O. PearceApr 5, 2009
  10. Shawn O. PearceApr 5, 2009
  11. Robin RosenbergApr 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.