diff options
Diffstat (limited to 'xdelta3')
-rwxr-xr-x | xdelta3/xdelta3-regtest.py | 54 | ||||
-rw-r--r-- | xdelta3/xdelta3.c | 2 | ||||
-rw-r--r-- | xdelta3/xdelta3.h | 3 |
3 files changed, 30 insertions, 29 deletions
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py index f8edb9e..adc240e 100755 --- a/xdelta3/xdelta3-regtest.py +++ b/xdelta3/xdelta3-regtest.py | |||
@@ -24,7 +24,7 @@ import xdelta3main | |||
24 | import xdelta3 | 24 | import xdelta3 |
25 | 25 | ||
26 | #RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS' | 26 | #RCSDIR = '/mnt/polaroid/Polaroid/orbit_linux/home/jmacd/PRCS' |
27 | RCSDIR = '/tmp/PRCS_read_copy/prcs' | 27 | RCSDIR = '/tmp/PRCS_read_copy' |
28 | SAMPLEDIR = "/tmp/WESNOTH_tmp/diff" | 28 | SAMPLEDIR = "/tmp/WESNOTH_tmp/diff" |
29 | 29 | ||
30 | #RCSDIR = 'G:/jmacd/PRCS/prcs/b' | 30 | #RCSDIR = 'G:/jmacd/PRCS/prcs/b' |
@@ -39,12 +39,14 @@ SKIP_TRIALS = 2 | |||
39 | MIN_TRIALS = 3 | 39 | MIN_TRIALS = 3 |
40 | MAX_TRIALS = 15 | 40 | MAX_TRIALS = 15 |
41 | 41 | ||
42 | SKIP_DECODE = 1 | ||
43 | |||
42 | # 10 = fast 1.5 = slow | 44 | # 10 = fast 1.5 = slow |
43 | MIN_STDDEV_PCT = 1.5 | 45 | MIN_STDDEV_PCT = 1.5 |
44 | 46 | ||
45 | # How many results per round | 47 | # How many results per round |
46 | MAX_RESULTS = 4 | 48 | MAX_RESULTS = 400 |
47 | KEEP_P = (1.0) | 49 | KEEP_P = (0.5) |
48 | FAST_P = (0.0) | 50 | FAST_P = (0.0) |
49 | SLOW_P = (0.0) | 51 | SLOW_P = (0.0) |
50 | 52 | ||
@@ -98,18 +100,18 @@ def INPUT_SPEC(rand): | |||
98 | 100 | ||
99 | # -C 1,2,3,4,5,6,7 | 101 | # -C 1,2,3,4,5,6,7 |
100 | 'large_look' : lambda d: rand.choice([9]), | 102 | 'large_look' : lambda d: rand.choice([9]), |
101 | 'large_step' : lambda d: rand.choice([15]), | 103 | 'large_step' : lambda d: rand.choice([2, 3, 8, 15]), |
102 | 'small_chain' : lambda d: rand.choice([1]), | 104 | 'small_chain' : lambda d: rand.choice([40, 10, 4, 1]), |
103 | 'small_lchain' : lambda d: rand.choice([1]), | 105 | 'small_lchain' : lambda d: rand.choice([x for x in [10, 4, 2, 1] if x <= d['small_chain']]), |
104 | 'max_lazy' : lambda d: rand.choice([18]), | 106 | 'max_lazy' : lambda d: rand.choice([9, 18, 27, 36, 72, 108]), |
105 | 'long_enough' : lambda d: rand.choice([18]), | 107 | 'long_enough' : lambda d: rand.choice([9, 18, 27, 36, 72, 108]), |
106 | 'small_look' : lambda d: rand.choice([4, 5]), | 108 | 'small_look' : lambda d: rand.choice([4]), |
107 | 109 | ||
108 | # -N | 110 | # -N |
109 | 'nocompress' : lambda d: rand.choice(['false']), | 111 | 'nocompress' : lambda d: rand.choice(['false']), |
110 | 112 | ||
111 | # -T | 113 | # -T |
112 | 'altcode' : lambda d: rand.choice(['false', 'true']), | 114 | 'altcode' : lambda d: rand.choice(['false']), |
113 | 115 | ||
114 | # -S djw | 116 | # -S djw |
115 | 'djw' : lambda d: rand.choice(['false']), | 117 | 'djw' : lambda d: rand.choice(['false']), |
@@ -165,7 +167,7 @@ def SumList(l): | |||
165 | # returns (total, mean, stddev, q2 (median), | 167 | # returns (total, mean, stddev, q2 (median), |
166 | # (q3-q1)/2 ("semi-interquartile range"), max-min (spread)) | 168 | # (q3-q1)/2 ("semi-interquartile range"), max-min (spread)) |
167 | class StatList: | 169 | class StatList: |
168 | def __init__(self,l,desc,hist=0): | 170 | def __init__(self,l,desc): |
169 | cnt = len(l) | 171 | cnt = len(l) |
170 | assert(cnt > 1) | 172 | assert(cnt > 1) |
171 | l.sort() | 173 | l.sort() |
@@ -227,8 +229,15 @@ class TimedTest: | |||
227 | self.encode_time = self.DoTest(DFILE, | 229 | self.encode_time = self.DoTest(DFILE, |
228 | lambda x: x.Encode(self.target, self.source, DFILE)) | 230 | lambda x: x.Encode(self.target, self.source, DFILE)) |
229 | self.encode_size = runnable.EncodeSize(DFILE) | 231 | self.encode_size = runnable.EncodeSize(DFILE) |
232 | |||
233 | if SKIP_DECODE: | ||
234 | self.decode_time = StatList([1, 1], 'not decoded') | ||
235 | return | ||
236 | #end | ||
237 | |||
230 | self.decode_time = self.DoTest(RFILE, | 238 | self.decode_time = self.DoTest(RFILE, |
231 | lambda x: x.Decode(DFILE, self.source, RFILE)) | 239 | lambda x: x.Decode(DFILE, self.source, RFILE), |
240 | ) | ||
232 | 241 | ||
233 | # verify | 242 | # verify |
234 | runnable.Verify(self.target, RFILE) | 243 | runnable.Verify(self.target, RFILE) |
@@ -658,15 +667,6 @@ class RcsFile: | |||
658 | 667 | ||
659 | target_size = os.stat(self.Verf(v+1)).st_size | 668 | target_size = os.stat(self.Verf(v+1)).st_size |
660 | 669 | ||
661 | if 0: | ||
662 | print '%s %s %s: %.2f%% encode %.3f ms: decode %.3f ms' % \ | ||
663 | (runclass, | ||
664 | os.path.basename(self.fname), | ||
665 | self.Vstr(v+1), | ||
666 | target_size > 0 and (100.0 * result.encode_size / target_size) or 0, | ||
667 | result.encode_time.mean * 1000.0, | ||
668 | result.decode_time.mean * 1000.0) | ||
669 | #end | ||
670 | ntrials.append(result) | 670 | ntrials.append(result) |
671 | #end | 671 | #end |
672 | 672 | ||
@@ -780,8 +780,8 @@ def GetTestRcsFiles(): | |||
780 | len(rcsf.subdirs), | 780 | len(rcsf.subdirs), |
781 | len(rcsf.others), | 781 | len(rcsf.others), |
782 | len(rcsf.skipped)) | 782 | len(rcsf.skipped)) |
783 | print StatList([x.rcssize for x in rcsf.rcsfiles], "rcssize", 1).str | 783 | print StatList([x.rcssize for x in rcsf.rcsfiles], "rcssize").str |
784 | print StatList([x.totrev for x in rcsf.rcsfiles], "totrev", 1).str | 784 | print StatList([x.totrev for x in rcsf.rcsfiles], "totrev").str |
785 | return rcsf | 785 | return rcsf |
786 | #end | 786 | #end |
787 | 787 | ||
@@ -800,11 +800,15 @@ class RandomTestResult: | |||
800 | #end | 800 | #end |
801 | 801 | ||
802 | def __str__(self): | 802 | def __str__(self): |
803 | return 'time %.6f%s size %d%s << %s >> %.6f' % ( | 803 | decodestr = '' |
804 | if not SKIP_DECODE: | ||
805 | decodestr = ' %.6f' % self.decodetime | ||
806 | #end | ||
807 | return 'time %.6f%s size %d%s << %s >>%s' % ( | ||
804 | self.time(), ((self.time_pos != None) and (" (%s)" % self.time_pos) or ""), | 808 | self.time(), ((self.time_pos != None) and (" (%s)" % self.time_pos) or ""), |
805 | self.size(), ((self.size_pos != None) and (" (%s)" % self.size_pos) or ""), | 809 | self.size(), ((self.size_pos != None) and (" (%s)" % self.size_pos) or ""), |
806 | c2s(self.config()), | 810 | c2s(self.config()), |
807 | self.decodetime) | 811 | decodestr) |
808 | #end | 812 | #end |
809 | 813 | ||
810 | def time(self): | 814 | def time(self): |
diff --git a/xdelta3/xdelta3.c b/xdelta3/xdelta3.c index 5ce566d..c05a021 100644 --- a/xdelta3/xdelta3.c +++ b/xdelta3/xdelta3.c | |||
@@ -3907,7 +3907,7 @@ xd3_process_memory (int is_encode, | |||
3907 | if (is_encode) | 3907 | if (is_encode) |
3908 | { | 3908 | { |
3909 | config.srcwin_maxsz = source_size; | 3909 | config.srcwin_maxsz = source_size; |
3910 | config.winsize = min(input_size, (usize_t) (1<<20)); | 3910 | config.winsize = min(input_size, (usize_t) XD3_DEFAULT_WINSIZE); |
3911 | config.iopt_size = min(input_size / 32, XD3_DEFAULT_IOPT_SIZE); | 3911 | config.iopt_size = min(input_size / 32, XD3_DEFAULT_IOPT_SIZE); |
3912 | config.iopt_size = max(config.iopt_size, 128U); | 3912 | config.iopt_size = max(config.iopt_size, 128U); |
3913 | 3913 | ||
diff --git a/xdelta3/xdelta3.h b/xdelta3/xdelta3.h index 5cca657..4aa9613 100644 --- a/xdelta3/xdelta3.h +++ b/xdelta3/xdelta3.h | |||
@@ -102,9 +102,6 @@ typedef u_int32_t uint32_t; | |||
102 | 102 | ||
103 | typedef u_int64_t uint64_t; | 103 | typedef u_int64_t uint64_t; |
104 | #else | 104 | #else |
105 | // CRT_SECURE_NO_DEPRECATE silences warnings about sprintf() and strerror() | ||
106 | #define _CRT_SECURE_NO_DEPRECATE 1 | ||
107 | #define _CRT_SECURE_COPP_OVERLOAD_STANDARD_NAMES 1 | ||
108 | #define WIN32_LEAN_AND_MEAN | 105 | #define WIN32_LEAN_AND_MEAN |
109 | #include <windows.h> | 106 | #include <windows.h> |
110 | #define inline | 107 | #define inline |