diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java index 46c412b94..ee7ffae01 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java @@ -645,10 +645,12 @@ private void searchForReuse(ProgressMonitor monitor) throws IOException { int cnt = 0; for (List list : objectsLists) cnt += list.size(); + long start = System.currentTimeMillis(); monitor.beginTask(JGitText.get().searchForReuse, cnt); for (List list : objectsLists) reuseSupport.selectObjectRepresentation(this, monitor, list); monitor.endTask(); + stats.timeSearchingForReuse = System.currentTimeMillis() - start; } private void searchForDeltas(ProgressMonitor monitor) @@ -685,6 +687,7 @@ private void searchForDeltas(ProgressMonitor monitor) // search code to discover the missing object and skip over it, or // abort with an exception if we actually had to have it. // + final long sizingStart = System.currentTimeMillis(); monitor.beginTask(JGitText.get().searchForSizes, cnt); AsyncObjectSizeQueue sizeQueue = reader.getObjectSize( Arrays. asList(list).subList(0, cnt), false); @@ -731,6 +734,7 @@ else if (sz <= DeltaIndex.BLKSZ) sizeQueue.release(); } monitor.endTask(); + stats.timeSearchingForSizes = System.currentTimeMillis() - sizingStart; // Sort the objects by path hash so like files are near each other, // and then by size descending so that bigger files are first. This @@ -1531,6 +1535,10 @@ public static class Statistics { long timeCounting; + long timeSearchingForReuse; + + long timeSearchingForSizes; + long timeCompressing; long timeWriting; @@ -1641,6 +1649,25 @@ public long getTimeCounting() { return timeCounting; } + /** + * @return time in milliseconds spent matching existing representations + * against objects that will be transmitted, or that the client + * can be assumed to already have. + */ + public long getTimeSearchingForReuse() { + return timeSearchingForReuse; + } + + /** + * @return time in milliseconds spent finding the sizes of all objects + * that will enter the delta compression search window. The + * sizes need to be known to better match similar objects + * together and improve delta compression ratios. + */ + public long getTimeSearchingForSizes() { + return timeSearchingForSizes; + } + /** * @return time in milliseconds spent on delta compression. This is * observed wall-clock time and does not accurately track CPU