google / git-appraise

Distributed code review system for Git repos
Apache License 2.0
5.13k stars 146 forks source link

Two substantial performance improvements for listing reviews: #49

Closed ojarjur closed 8 years ago

ojarjur commented 8 years ago
  1. Add a GetAllNotes method to the Repo interface. This reads the contents for all git-notes under the given ref in a single batch operation. This is faster than the old method because we only shell out to the git command a fixed number of times rather than doing so repeatedely for every single review.
  2. When checking each review to see if it has been submitted, cache the set of commits reachable from each target ref, and use that for determining submitted status. This saves us from having to reperform the (linear) scan of the git history for every review.

With these changes, listing the reviews for the git-appraise repo drops from taking ~2 seconds to ~0.15 seconds.

For one particular test repo, with 15k reviews, this drops the list latency from 48 minutes to 6 seconds.