]> source.dussan.org Git - jgit.git/commit
Split delta search buckets by byte weight 76/11876/6
authorShawn Pearce <spearce@spearce.org>
Tue, 16 Apr 2013 15:19:13 +0000 (08:19 -0700)
committerShawn Pearce <sop@google.com>
Wed, 17 Apr 2013 18:31:00 +0000 (11:31 -0700)
commit21e4aa2b9eaf392825e52ada6034cc3044c69c67
tree32f7a6735c2d406bb8e5007d3299ad790e05c1f0
parent5f03dc61b46f1eddc09c1fc2963891be48dcc99c
Split delta search buckets by byte weight

Instead of assuming all objects cost the same amount of time to
delta compress, aggregate the byte size of objects in the list
and partition threads with roughly equal total bytes.

Before splitting the list select the N largest paths and assign
each one to its own thread. This allows threads to get through the
worst cases in parallel before attempting smaller paths that are
more likely to be splittable.

By running the largest path buckets first on each thread the likely
slowest part of compression is done early, while progress is still
reporting a low percentage. This gives users a better impression of
how fast the phase will run. On very complex inputs the slow part
is more likely to happen first, making a user realize its time to
go grab lunch, or even run it overnight.

If the worst sections are earlier, memory overruns may show up
earlier, giving the user a chance to correct the configuration and
try again before wasting large amounts of time. It also makes it
less likely the delta compression phase reaches 92% in 30 minutes
and then crawls for 10 hours through the remaining 8%.

Change-Id: I7621c4349b99e40098825c4966b8411079992e5f
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaTask.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaWindow.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java