Refactor to optimize storage driver ApplyDiff()

To avoid an expensive call to archive.ChangesDirs() which walks two directory
trees and compares every entry, archive.ApplyLayer() has been extended to
also return the size of the layer changes.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
Josh Hawn 2014-12-17 18:26:03 -08:00
parent 52679b2b7f
commit c57c03f841
5 changed files with 61 additions and 29 deletions

View file

@ -286,7 +286,7 @@ func TestApplyLayer(t *testing.T) {
t.Fatal(err)
}
if err := ApplyLayer(src, layerCopy); err != nil {
if _, err := ApplyLayer(src, layerCopy); err != nil {
t.Fatal(err)
}