Skip to content

Commit

Permalink
文件重命名
Browse files Browse the repository at this point in the history
  • Loading branch information
sisong committed Apr 25, 2018
1 parent 7e3aaf0 commit ec06af3
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 86 deletions.
69 changes: 35 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
**HDiffPatch**
================
[![release](https://img.shields.io/badge/release-v3.0-blue.svg)](https://github.com/sisong/HDiffPatch/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/HDiffPatch/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/HDiffPatch/pulls)
[![release](https://img.shields.io/badge/release-v2.4-blue.svg)](https://github.com/sisong/HDiffPatch/releases) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/HDiffPatch/blob/master/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/HDiffPatch/pulls)
binary data Diff & Patch C\C++ library.

---
## command line usage:
**hdiff** [-m[-matchScore]|-s[-matchBlockSize]] [-c-compressType[-compressLevel]] [-o] **oldFile newFile outDiffFile**
**hdiffz** [-m[-matchScore]|-s[-matchBlockSize]] [-c-compressType[-compressLevel]] [-o] **oldFile newFile outDiffFile**
```
memory options:
-m-matchScore
Expand All @@ -30,9 +30,9 @@ special options:
-zstd[-{0..22}] DEFAULT level 20
-o Original diff, unsupport run with -s or -c, DEPRECATED;
compatible with "diff_demo.c",
diffFile must patch by "patch_demo.cpp" or "hpatch -o ..."
diffFile must patch by "patch_demo.cpp" or "hpatchz -o ..."
```
**hpatch** [-m|-s[-nbytes]] [-o] **oldFile diffFile outNewFile**
**hpatchz** [-m|-s[-nbytes]] [-o] **oldFile diffFile outNewFile**
```
memory options:
-m oldFile all load into Memory;
Expand All @@ -43,11 +43,11 @@ memory options:
nbytes can like 524288 or 512k or 128m(DEFAULT) or 1g etc...
special options:
-o Original patch, DEPRECATED; compatible with "patch_demo.c",
diffFile must created by "diff_demo.cpp" or "hdiff -o ..."
diffFile must created by "diff_demo.cpp" or "hdiffz -o ..."
```

---
## library usage:
## library API usage:

* **create_diff**(newData,oldData,out diffData);

Expand All @@ -73,14 +73,14 @@ special options:
system: macOS10.12.6, compiler: xcode8.3.3 x64, CPU: i7 2.5G(turbo3.7G,6MB L3 cache),SSD Disk,Memroy:8G*2 DDR3 1600MHz
(purge file cache before every test)
```
HDiffPatch hdiff run by: -m -c-bzip2|-lzma|-zlib oldFile newFile outDiffFile
        hpatch run by: -m oldFile diffFile outNewFile
HDiffPatch2.4 hdiffz run by: -m -c-bzip2-9|-c-lzma-7-4m|-c-zlib-9 oldFile newFile outDiffFile
        hpatchz run by: -m oldFile diffFile outNewFile
BsDiff4.3 with bzip2 and all data in memory;
(when compiling BsDiff4.3-x64, suffix string index type int64 changed to int32,
faster and memroy requires to be halved.)
(NOTE: when compiling BsDiff4.3-x64, suffix string index type int64 changed to int32,
faster and memroy requires to be halved!)
=======================================================================================================
        Program               Uncompressed Compressed Compressed BsDiff4.3 HDiff2.0
(newVersion<--oldVersion)           (tar)     (bzip2)   (lzma)   (bzip2)   (bzip2 lzma zlib)
        Program               Uncompressed Compressed Compressed BsDiff hdiffz
(newVersion<--oldVersion)           (tar)     (bzip2)   (lzma)   (bzip2)   (bzip2 lzma zlib)
-------------------------------------------------------------------------------------------------------
apache-maven-2.2.1-src <--2.0.11 5150720 1213258 1175464 115723 83935 80997 91921
httpd_2.4.4-netware-bin <--2.2.24 22612480 4035904 3459747 2192308 1809555 1616435 1938953
Expand All @@ -96,8 +96,8 @@ Average Compression 100.00% 31.76% 28.47% 6.64% 5
=======================================================================================================
  Program   run time(Second) memory(MB)     run time(Second)     memory(MB)
BsDiff HDiff BsDiff HDiff BsPatch HPatch2.0 BsPatch HPatch2.0
(bzip2)(bzip2) (bzip2)(bzip2) (bzip2) (bzip2 lzma zlib) (bzip2)(bzip2 lzma zlib)
BsDiff hdiffz BsDiff hdiffz BsPatch hpatchz BsPatch hpatchz
(bzip2)(bzip2) (bzip2)(bzip2) (bzip2) (bzip2 lzma zlib) (bzip2) (bzip2 lzma zlib)
-------------------------------------------------------------------------------------------------------
apache-maven... 1.3 0.4 42 28 0.09 0.04 0.03 0.02 14 8 7 6
httpd bin... 8.6 3.0 148 124 0.72 0.36 0.18 0.13 50 24 23 18
Expand All @@ -111,39 +111,40 @@ Average 100% 28.9% 100% 71.5% 100% 52.3% 29.9% 21.3% 1
=======================================================================================================
```


```
HDiffPatch hdiff run by: -s-128 -c-bzip2 oldFile newFile outDiffFile
        hpatch run by: -s-4m oldFile diffFile outNewFile
HDiffPatch2.4 hdiffz run by: -s-128 -c-bzip2-9 oldFile newFile outDiffFile
        hpatchz run by: -s-4m oldFile diffFile outNewFile
xdelta3.1 diff run by: -e -s old_file new_file delta_file
patch run by: -d -s old_file delta_file decoded_new_file
(note fix: xdelta3.1 diff "gcc-src..." fail, add -B 530000000 diff ok,
out 14173073B and used 1070MB memory.)
patch run by: -d -s old_file delta_file decoded_new_file
(NOTE fix: xdelta3.1 diff "gcc-src..." fail, add -B 530000000 diff ok,
out 14173073B and used 1070MB memory!)
=======================================================================================================
  Program   diff run time(Second) memory(MB)   patch run time(Second) memory(MB)
xdelta3 HDiff xdelta3 HDiff xdelta3 HDiff xdelta3 HPatch2.0 xdelta3 HPatch
xdelta3 hdiffz xdelta3 hdiffz xdelta3 hdiffz xdelta3 hpatchz xdelta3 hpatchz
-------------------------------------------------------------------------------------------------------
apache-maven... 116265 83408 0.16 0.13 65 11 0.07 0.06 12 6
httpd bin... 2174098 2077625 1.1 1.2 157 15 0.25 0.65 30 8
httpd src... 2312990 2034666 1.3 1.7 185 15 0.30 0.91 50 8
Firefox... 28451567 27504156 16 11 225 16 2.0 4.1 100 8
emacs... 31655323 12033450 19 9.4 220 33 3.2 4.0 97 10
eclipse 1590860 1636221 1.5 1.2 207 34 0.46 0.49 77 8
gcc-src... 107003829 12305741 56 19 224 79 9.7 9.5 102 11
apache-maven... 116265 83408 0.16 0.13 65 11 0.07 0.06 12 6
httpd bin... 2174098 2077625 1.1 1.2 157 15 0.25 0.65 30 8
httpd src... 2312990 2034666 1.3 1.7 185 15 0.30 0.91 50 8
Firefox... 28451567 27504156 16 11 225 16 2.0 4.1 100 8
emacs... 31655323 12033450 19 9.4 220 33 3.2 4.0 97 10
eclipse 1590860 1636221 1.5 1.2 207 34 0.46 0.49 77 8
gcc-src... 107003829 12305741 56 19 224 79 9.7 9.5 102 11
(fix 14173073)
-------------------------------------------------------------------------------------------------------
Average 12.18% 7.81% 100% 79.0% 100% 15.5% 100% 169.1% 100% 18.9%
Average 12.18% 7.81% 100% 79.0% 100% 15.5% 100% 169.1% 100% 18.9%
(fix 9.78%)
=======================================================================================================
HDiffPatch hdiff run by: -s-64 -c-lzma oldFile newFile outDiffFile
        hpatch run by: -s-4m oldFile diffFile outNewFile
HDiffPatch hdiffz run by: -s-64 -c-lzma-7-4m oldFile newFile outDiffFile
        hpatchz run by: -s-4m oldFile diffFile outNewFile
xdelta3.1 diff run by: -S lzma -9 -s old_file new_file delta_file
patch run by: -d -s old_file delta_file decoded_new_file
(note fix: xdelta3.1 diff "gcc-src..." fail, add -B 530000000 diff ok,
out 11787978B and used 2639MB memory.)
patch run by: -d -s old_file delta_file decoded_new_file
(NOTE fix: xdelta3.1 diff "gcc-src..." fail, add -B 530000000 diff ok,
out 11787978B and used 2639MB memory.)
=======================================================================================================
  Program   diff run time(Second) memory(MB)   patch run time(Second) memory(MB)
xdelta3 HDiff xdelta3 HDiff xdelta3 HDiff xdelta3 HPatch2.0 xdelta3 HPatch
xdelta3 hdiffz xdelta3 hdiffz xdelta3 hdiffz xdelta3 hpatchz xdelta3 hpatchz
-------------------------------------------------------------------------------------------------------
apache-maven... 98434 83668 0.37 0.29 220 24 0.04 0.06 12 5
httpd bin... 1986880 1776553 2.5 2.9 356 59 0.24 0.52 30 8
Expand Down
4 changes: 2 additions & 2 deletions builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions builds/xcode/bestParams.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
80D1B2A5199A40A700F6B3A8 /* bytes_rle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 80D1B29B199A40A700F6B3A8 /* bytes_rle.cpp */; };
80D1B2A6199A40A700F6B3A8 /* suffix_string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 80D1B29F199A40A700F6B3A8 /* suffix_string.cpp */; };
80D1B2A7199A40A700F6B3A8 /* patch.c in Sources */ = {isa = PBXBuildFile; fileRef = 80D1B2A2199A40A700F6B3A8 /* patch.c */; };
80D6A84219B73AB30041C1D7 /* _private_searchBestParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 80D6A84119B73AB30041C1D7 /* _private_searchBestParams.cpp */; };
D639ACDE208B458500811BB3 /* _private_searchBestParams.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D639ACDD208B458500811BB3 /* _private_searchBestParams.cpp */; };
D66166271E189F5A005C570A /* divsufsort.c in Sources */ = {isa = PBXBuildFile; fileRef = D661661E1E189F5A005C570A /* divsufsort.c */; };
D66166281E189F5A005C570A /* divsufsort64.c in Sources */ = {isa = PBXBuildFile; fileRef = D66166211E189F5A005C570A /* divsufsort64.c */; };
D68CD9151F469DDB00A61337 /* adler_roll.c in Sources */ = {isa = PBXBuildFile; fileRef = D68CD90D1F469DDB00A61337 /* adler_roll.c */; };
Expand Down Expand Up @@ -46,7 +46,7 @@
80D1B2A0199A40A700F6B3A8 /* suffix_string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = suffix_string.h; sourceTree = "<group>"; };
80D1B2A2199A40A700F6B3A8 /* patch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = patch.c; sourceTree = "<group>"; };
80D1B2A3199A40A700F6B3A8 /* patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = patch.h; sourceTree = "<group>"; };
80D6A84119B73AB30041C1D7 /* _private_searchBestParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = _private_searchBestParams.cpp; path = ../_private_searchBestParams.cpp; sourceTree = "<group>"; };
D639ACDD208B458500811BB3 /* _private_searchBestParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = _private_searchBestParams.cpp; path = ../../test/_private_searchBestParams.cpp; sourceTree = "<group>"; };
D661661D1E189F5A005C570A /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
D661661E1E189F5A005C570A /* divsufsort.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = divsufsort.c; sourceTree = "<group>"; };
D661661F1E189F5A005C570A /* divsufsort.c.inc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = divsufsort.c.inc.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -178,7 +178,7 @@
D6CB33581664FD2900AB34B7 = {
isa = PBXGroup;
children = (
80D6A84119B73AB30041C1D7 /* _private_searchBestParams.cpp */,
D639ACDD208B458500811BB3 /* _private_searchBestParams.cpp */,
80D1B296199A40A700F6B3A8 /* libHDiffPatch */,
D6CB33621664FD2900AB34B7 /* Products */,
D690A7B21F0E6F260089DC57 /* Frameworks */,
Expand Down Expand Up @@ -244,6 +244,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D639ACDE208B458500811BB3 /* _private_searchBestParams.cpp in Sources */,
D6EE50601F2990AD002854A2 /* compress_detect.cpp in Sources */,
D66166281E189F5A005C570A /* divsufsort64.c in Sources */,
D68CD9161F469DDB00A61337 /* digest_matcher.cpp in Sources */,
Expand All @@ -254,7 +255,6 @@
80D1B2A7199A40A700F6B3A8 /* patch.c in Sources */,
D68CD9151F469DDB00A61337 /* adler_roll.c in Sources */,
D68CD9171F469DDB00A61337 /* stream_serialize.cpp in Sources */,
80D6A84219B73AB30041C1D7 /* _private_searchBestParams.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
D64989831F600C27000FCC24 /* liblzma.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D64989821F600C27000FCC24 /* liblzma.a */; };
D64B4C032077C1C50039C38B /* libzstd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D64B4C022077C1C50039C38B /* libzstd.a */; };
D68CD8F21F4426B100A61337 /* stream_serialize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D68CD8F01F4426B100A61337 /* stream_serialize.cpp */; };
D690AB9C1F20792A0089DC57 /* hdiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D690AB9B1F20792A0089DC57 /* hdiff.cpp */; };
D690AB9C1F20792A0089DC57 /* hdiffz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D690AB9B1F20792A0089DC57 /* hdiffz.cpp */; };
D690ABB71F2079E80089DC57 /* diff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D690ABA01F2079E80089DC57 /* diff.cpp */; };
D690ABB81F2079E80089DC57 /* bytes_rle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D690ABA31F2079E80089DC57 /* bytes_rle.cpp */; };
D690ABB91F2079E80089DC57 /* divsufsort.c in Sources */ = {isa = PBXBuildFile; fileRef = D690ABA71F2079E80089DC57 /* divsufsort.c */; };
Expand Down Expand Up @@ -47,8 +47,8 @@
D68CD8F01F4426B100A61337 /* stream_serialize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stream_serialize.cpp; sourceTree = "<group>"; };
D68CD8F11F4426B100A61337 /* stream_serialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stream_serialize.h; sourceTree = "<group>"; };
D68CD8FF1F45D22C00A61337 /* file_for_patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_for_patch.h; path = ../../file_for_patch.h; sourceTree = "<group>"; };
D690AB911F2078A40089DC57 /* hdiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = hdiff; sourceTree = BUILT_PRODUCTS_DIR; };
D690AB9B1F20792A0089DC57 /* hdiff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hdiff.cpp; path = ../../hdiff.cpp; sourceTree = "<group>"; };
D690AB911F2078A40089DC57 /* hdiffz */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = hdiffz; sourceTree = BUILT_PRODUCTS_DIR; };
D690AB9B1F20792A0089DC57 /* hdiffz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hdiffz.cpp; path = ../../hdiffz.cpp; sourceTree = "<group>"; };
D690ABA01F2079E80089DC57 /* diff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = diff.cpp; sourceTree = "<group>"; };
D690ABA11F2079E80089DC57 /* diff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = diff.h; sourceTree = "<group>"; };
D690ABA31F2079E80089DC57 /* bytes_rle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bytes_rle.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -107,7 +107,7 @@
D6E150981F223B2700C2AD3D /* compress_plugin_demo.h */,
D6E1509A1F223DC100C2AD3D /* decompress_plugin_demo.h */,
D68CD8FF1F45D22C00A61337 /* file_for_patch.h */,
D690AB9B1F20792A0089DC57 /* hdiff.cpp */,
D690AB9B1F20792A0089DC57 /* hdiffz.cpp */,
D690AB921F2078A40089DC57 /* Products */,
D690ABBD1F20832E0089DC57 /* Frameworks */,
);
Expand All @@ -116,7 +116,7 @@
D690AB921F2078A40089DC57 /* Products */ = {
isa = PBXGroup;
children = (
D690AB911F2078A40089DC57 /* hdiff */,
D690AB911F2078A40089DC57 /* hdiffz */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -216,9 +216,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
D690AB901F2078A40089DC57 /* hdiff */ = {
D690AB901F2078A40089DC57 /* hdiffz */ = {
isa = PBXNativeTarget;
buildConfigurationList = D690AB981F2078A40089DC57 /* Build configuration list for PBXNativeTarget "hdiff" */;
buildConfigurationList = D690AB981F2078A40089DC57 /* Build configuration list for PBXNativeTarget "hdiffz" */;
buildPhases = (
D690AB8D1F2078A40089DC57 /* Sources */,
D690AB8E1F2078A40089DC57 /* Frameworks */,
Expand All @@ -228,9 +228,9 @@
);
dependencies = (
);
name = hdiff;
productName = hdiff;
productReference = D690AB911F2078A40089DC57 /* hdiff */;
name = hdiffz;
productName = hdiffz;
productReference = D690AB911F2078A40089DC57 /* hdiffz */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
Expand All @@ -248,7 +248,7 @@
};
};
};
buildConfigurationList = D690AB8C1F2078A40089DC57 /* Build configuration list for PBXProject "hdiff" */;
buildConfigurationList = D690AB8C1F2078A40089DC57 /* Build configuration list for PBXProject "hdiffz" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
Expand All @@ -260,7 +260,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
D690AB901F2078A40089DC57 /* hdiff */,
D690AB901F2078A40089DC57 /* hdiffz */,
);
};
/* End PBXProject section */
Expand All @@ -278,7 +278,7 @@
D690ABB71F2079E80089DC57 /* diff.cpp in Sources */,
D690ABBA1F2079E80089DC57 /* divsufsort64.c in Sources */,
D690ABB91F2079E80089DC57 /* divsufsort.c in Sources */,
D690AB9C1F20792A0089DC57 /* hdiff.cpp in Sources */,
D690AB9C1F20792A0089DC57 /* hdiffz.cpp in Sources */,
D68CD8F21F4426B100A61337 /* stream_serialize.cpp in Sources */,
D6DD68E31F40163200A1B22B /* adler_roll.c in Sources */,
);
Expand Down Expand Up @@ -409,7 +409,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
D690AB8C1F2078A40089DC57 /* Build configuration list for PBXProject "hdiff" */ = {
D690AB8C1F2078A40089DC57 /* Build configuration list for PBXProject "hdiffz" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D690AB961F2078A40089DC57 /* Debug */,
Expand All @@ -418,7 +418,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D690AB981F2078A40089DC57 /* Build configuration list for PBXNativeTarget "hdiff" */ = {
D690AB981F2078A40089DC57 /* Build configuration list for PBXNativeTarget "hdiffz" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D690AB991F2078A40089DC57 /* Debug */,
Expand Down
Loading

0 comments on commit ec06af3

Please sign in to comment.