Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

format/packfile: improve binary delta algorithm #400

Merged
merged 1 commit into from
May 24, 2017
Merged

format/packfile: improve binary delta algorithm #400

merged 1 commit into from
May 24, 2017

Conversation

ajnavarro
Copy link
Contributor

@ajnavarro ajnavarro commented May 23, 2017

Implement Xdelta algorithm from this paper (http://pop.xmailserver.net/xdfs.pdf) using adler32 checksum for fingerprinting and 16 bytes chunks, like in git.

Fixes #390

@ajnavarro
Copy link
Contributor Author

Using the same source and target to create the deltas:

  • old version: 379373078 ns/op
  • new version: 613210 ns/op

@codecov
Copy link

codecov bot commented May 23, 2017

Codecov Report

Merging #400 into master will decrease coverage by 0.62%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #400      +/-   ##
==========================================
- Coverage   77.71%   77.09%   -0.63%     
==========================================
  Files         125      124       -1     
  Lines        9106     9001     -105     
==========================================
- Hits         7077     6939     -138     
- Misses       1247     1303      +56     
+ Partials      782      759      -23
Impacted Files Coverage Δ
plumbing/format/packfile/diff_delta.go 90.74% <100%> (+5.37%) ⬆️
plumbing/transport/ssh/common.go 0% <0%> (-50.91%) ⬇️
plumbing/transport/ssh/auth_method.go 32.4% <0%> (-24.08%) ⬇️
plumbing/format/packfile/patch_delta.go 70.7% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f663a93...f369a78. Read the comment docs.

@alcortesm
Copy link
Contributor

alcortesm commented May 24, 2017

Speed!

Copy link
Contributor

@alcortesm alcortesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a reference to the paper in a comment, so next person to review, modify or use your code knows how to understand it and also to give credit to the original authors.

Implemented algorithm described in "File System Support for Delta Compression" paper, from "Joshua P. MacDonald".
@ajnavarro
Copy link
Contributor Author

@alcortesm I added the name of the author and the paper title, because the link can disappear.

Copy link
Contributor

@alcortesm alcortesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent call.

I would have added that to the code itself, close to where people will need it, instead of on the commit message.

@smola smola merged commit 7e249df into src-d:master May 24, 2017
@ajnavarro ajnavarro deleted the improvement/diff-delta branch May 24, 2017 09:58
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants