diff options
Diffstat (limited to 'xdelta3')
-rwxr-xr-x | xdelta3/Makefile | 3 | ||||
-rwxr-xr-x | xdelta3/setup.py | 2 | ||||
-rwxr-xr-x | xdelta3/xdelta3-main.h | 5 | ||||
-rwxr-xr-x | xdelta3/xdelta3-regtest.py | 78 | ||||
-rwxr-xr-x | xdelta3/xdelta3.prj | 2 |
5 files changed, 76 insertions, 14 deletions
diff --git a/xdelta3/Makefile b/xdelta3/Makefile index 1bb4664..968ab15 100755 --- a/xdelta3/Makefile +++ b/xdelta3/Makefile | |||
@@ -30,7 +30,7 @@ EXTRA = Makefile COPYING linkxd3lib.c badcopy.c www \ | |||
30 | draft-korn-vcdiff.txt xdelta3.vcproj badcopy.vcproj | 30 | draft-korn-vcdiff.txt xdelta3.vcproj badcopy.vcproj |
31 | 31 | ||
32 | # $Format: "REL=$Xdelta3Version$" $ | 32 | # $Format: "REL=$Xdelta3Version$" $ |
33 | REL=0j | 33 | REL=0k |
34 | RELDIR = xdelta3$(REL) | 34 | RELDIR = xdelta3$(REL) |
35 | 35 | ||
36 | all: xdelta3-debug xdelta3 $(PYTGT) | 36 | all: xdelta3-debug xdelta3 $(PYTGT) |
@@ -50,6 +50,7 @@ tar: | |||
50 | 50 | ||
51 | clean: | 51 | clean: |
52 | rm -f $(TARGETS) | 52 | rm -f $(TARGETS) |
53 | rm -rf build Debug Release | ||
53 | 54 | ||
54 | xdelta3: $(SOURCES) | 55 | xdelta3: $(SOURCES) |
55 | $(CC) -O3 -Wall -Wshadow xdelta3.c -lm -o xdelta3 \ | 56 | $(CC) -O3 -Wall -Wshadow xdelta3.c -lm -o xdelta3 \ |
diff --git a/xdelta3/setup.py b/xdelta3/setup.py index 8691bfb..ffde8ad 100755 --- a/xdelta3/setup.py +++ b/xdelta3/setup.py | |||
@@ -33,7 +33,7 @@ xdelta3_ext = Extension('xdelta3', | |||
33 | ]) | 33 | ]) |
34 | 34 | ||
35 | # $Format: "REL='$Xdelta3Version$'" $ | 35 | # $Format: "REL='$Xdelta3Version$'" $ |
36 | REL='0j' | 36 | REL='0k' |
37 | 37 | ||
38 | setup(name='xdelta3', | 38 | setup(name='xdelta3', |
39 | version=REL, | 39 | version=REL, |
diff --git a/xdelta3/xdelta3-main.h b/xdelta3/xdelta3-main.h index 06190d0..e80b332 100755 --- a/xdelta3/xdelta3-main.h +++ b/xdelta3/xdelta3-main.h | |||
@@ -84,7 +84,7 @@ const char* xd3_mainerror(int err_num); | |||
84 | #define PRINTHDR_SPECIAL -4378291 | 84 | #define PRINTHDR_SPECIAL -4378291 |
85 | 85 | ||
86 | /* The number of soft-config variables. */ | 86 | /* The number of soft-config variables. */ |
87 | #define XD3_SOFTCFG_VARCNT 1 | 87 | #define XD3_SOFTCFG_VARCNT 10 |
88 | 88 | ||
89 | /* this is used as in XPR(NT XD3_LIB_ERRMSG (stream, ret)) to print an error message | 89 | /* this is used as in XPR(NT XD3_LIB_ERRMSG (stream, ret)) to print an error message |
90 | * from the library. */ | 90 | * from the library. */ |
@@ -2278,7 +2278,8 @@ main_input (xd3_cmd cmd, | |||
2278 | (got < XD3_SOFTCFG_VARCNT-1 && *e == 0) || | 2278 | (got < XD3_SOFTCFG_VARCNT-1 && *e == 0) || |
2279 | (got == XD3_SOFTCFG_VARCNT-1 && *e != 0)) | 2279 | (got == XD3_SOFTCFG_VARCNT-1 && *e != 0)) |
2280 | { | 2280 | { |
2281 | XPR(NT "invalid string match specifier (-C)\n"); | 2281 | XPR(NT "invalid string match specifier (-C) %d: %s\n", |
2282 | got, s); | ||
2282 | return EXIT_FAILURE; | 2283 | return EXIT_FAILURE; |
2283 | } | 2284 | } |
2284 | } | 2285 | } |
diff --git a/xdelta3/xdelta3-regtest.py b/xdelta3/xdelta3-regtest.py index 536c086..4cb3a35 100755 --- a/xdelta3/xdelta3-regtest.py +++ b/xdelta3/xdelta3-regtest.py | |||
@@ -21,7 +21,7 @@ | |||
21 | # TODO: This is really part test, part performance evaluation suite, and | 21 | # TODO: This is really part test, part performance evaluation suite, and |
22 | # really incomplete. | 22 | # really incomplete. |
23 | 23 | ||
24 | import os, sys, math, re, time, types, array | 24 | import os, sys, math, re, time, types, array, random |
25 | import xdelta3 | 25 | import xdelta3 |
26 | 26 | ||
27 | HIST_SIZE = 10 # the number of buckets | 27 | HIST_SIZE = 10 # the number of buckets |
@@ -31,7 +31,7 @@ TIME_TOO_SHORT = 0.050 | |||
31 | 31 | ||
32 | MIN_REPS = 1 | 32 | MIN_REPS = 1 |
33 | MAX_REPS = 1 | 33 | MAX_REPS = 1 |
34 | SKIP_TRIALS = 1 | 34 | SKIP_TRIALS = 2 |
35 | MIN_TRIALS = 3 | 35 | MIN_TRIALS = 3 |
36 | MAX_TRIALS = 15 | 36 | MAX_TRIALS = 15 |
37 | 37 | ||
@@ -216,6 +216,15 @@ class RcsFile: | |||
216 | os.remove(self.Verf(self.totrev-1)) | 216 | os.remove(self.Verf(self.totrev-1)) |
217 | os.remove(self.Verf(self.totrev-2)) | 217 | os.remove(self.Verf(self.totrev-2)) |
218 | return ntrials | 218 | return ntrials |
219 | |||
220 | def AppendVersion(self, f, n): | ||
221 | self.Checkout(n) | ||
222 | rf = open(self.Verf(n), "r") | ||
223 | data = rf.read() | ||
224 | f.write(data) | ||
225 | rf.close() | ||
226 | return len(data) | ||
227 | |||
219 | # | 228 | # |
220 | # This class recursively scans a directory for rcsfiles | 229 | # This class recursively scans a directory for rcsfiles |
221 | class RcsFinder: | 230 | class RcsFinder: |
@@ -428,6 +437,7 @@ def RunCommandIO(args,infn,outfn): | |||
428 | 437 | ||
429 | def RunXdelta3(args): | 438 | def RunXdelta3(args): |
430 | try: | 439 | try: |
440 | #print 'RUN', args | ||
431 | xdelta3.main(args) | 441 | xdelta3.main(args) |
432 | except Exception, e: | 442 | except Exception, e: |
433 | raise CommandError(args, "xdelta3.main exception") | 443 | raise CommandError(args, "xdelta3.main exception") |
@@ -453,6 +463,7 @@ class Xdelta3Pair: | |||
453 | self.type = 'xdelta3' | 463 | self.type = 'xdelta3' |
454 | self.decode_args = '-dqf' | 464 | self.decode_args = '-dqf' |
455 | self.encode_args = '-eqf' | 465 | self.encode_args = '-eqf' |
466 | self.extra = [] | ||
456 | self.presrc = '-s' | 467 | self.presrc = '-s' |
457 | self.canrep = 1 | 468 | self.canrep = 1 |
458 | 469 | ||
@@ -465,8 +476,9 @@ class Xdelta3Pair: | |||
465 | 476 | ||
466 | def Run(self,trial,reps): | 477 | def Run(self,trial,reps): |
467 | RunXdelta3(['-P', | 478 | RunXdelta3(['-P', |
468 | '%d' % reps, | 479 | '%d' % reps] + |
469 | self.encode_args, | 480 | self.extra + |
481 | [self.encode_args, | ||
470 | self.presrc, | 482 | self.presrc, |
471 | self.old, | 483 | self.old, |
472 | self.new, | 484 | self.new, |
@@ -498,7 +510,7 @@ def Test(): | |||
498 | len(rcsf.skipped)) | 510 | len(rcsf.skipped)) |
499 | print StatList([x.rcssize for x in rcsf.rcsfiles], "rcssize", 1).str | 511 | print StatList([x.rcssize for x in rcsf.rcsfiles], "rcssize", 1).str |
500 | print StatList([x.totrev for x in rcsf.rcsfiles], "totrev", 1).str | 512 | print StatList([x.totrev for x in rcsf.rcsfiles], "totrev", 1).str |
501 | pairs = rcsf.PairsByDate(Xdelta3Pair()) | 513 | return rcsf |
502 | 514 | ||
503 | def Decimals(max): | 515 | def Decimals(max): |
504 | l = [0] | 516 | l = [0] |
@@ -547,6 +559,52 @@ def ReportSpeed(L,tr,desc): | |||
547 | print '%s 0-run length %u: dsize %u: time %.3f ms: encode %.0f B/sec: in %ux%u trials' % \ | 559 | print '%s 0-run length %u: dsize %u: time %.3f ms: encode %.0f B/sec: in %ux%u trials' % \ |
548 | (desc, L, tr.r1.dsize, tr.time.mean * 1000.0, ((L+tr.r1.dsize) / tr.time.mean), tr.trials, tr.reps) | 560 | (desc, L, tr.r1.dsize, tr.time.mean * 1000.0, ((L+tr.r1.dsize) / tr.time.mean), tr.trials, tr.reps) |
549 | 561 | ||
562 | def BigFileRuns(rcsf): | ||
563 | rand = random.Random() | ||
564 | f1 = open(TMPDIR + "/big.1", "w") | ||
565 | f2 = open(TMPDIR + "/big.2", "w") | ||
566 | f1sz = 0 | ||
567 | f2sz = 0 | ||
568 | for file in rcsf.rcsfiles: | ||
569 | if file.versions < 2: | ||
570 | continue | ||
571 | r1 = 0 | ||
572 | r2 = 0 | ||
573 | while r1 == r2: | ||
574 | r1 = rand.randint(0, len(file.versions) - 1) | ||
575 | r2 = rand.randint(0, len(file.versions) - 1) | ||
576 | f1sz += file.AppendVersion(f1, r1) | ||
577 | f2sz += file.AppendVersion(f2, r2) | ||
578 | |||
579 | f1.close() | ||
580 | f2.close() | ||
581 | |||
582 | print "Test input sizes: %d %d" % (f1sz, f2sz) | ||
583 | |||
584 | while 1: | ||
585 | |||
586 | extras = [ | ||
587 | ['-1'], | ||
588 | ['-C', '32,32,4,2,2,1,0,0,64,0'], | ||
589 | ['-9'], | ||
590 | ['-C', '64,64,4,128,16,0,1,8,128,0'], | ||
591 | ] | ||
592 | |||
593 | for extra in extras: | ||
594 | runner = Xdelta3Pair() | ||
595 | runner.extra = extra | ||
596 | result = TimeRun(runner.Runner(TMPDIR + "/big.1", 1, | ||
597 | TMPDIR + "/big.2", 2)) | ||
598 | |||
599 | print 'testing %s dsize %d: time %.7f: in %u/%u trials' % \ | ||
600 | (extra, | ||
601 | result.r1.dsize, | ||
602 | result.time.mean, | ||
603 | result.trials, | ||
604 | result.reps) | ||
605 | # continue | ||
606 | # end | ||
607 | |||
550 | def RunSpeed(): | 608 | def RunSpeed(): |
551 | for L in Decimals(MAX_RUN): | 609 | for L in Decimals(MAX_RUN): |
552 | SetFileSize(RUNFILE, L) | 610 | SetFileSize(RUNFILE, L) |
@@ -558,9 +616,11 @@ def RunSpeed(): | |||
558 | if __name__ == "__main__": | 616 | if __name__ == "__main__": |
559 | try: | 617 | try: |
560 | os.mkdir(TMPDIR) | 618 | os.mkdir(TMPDIR) |
561 | Test() | 619 | rcsf = Test() |
562 | RunSpeed() | 620 | #rcsf.PairsByDate(Xdelta3Pair()) |
621 | #RunSpeed() | ||
622 | BigFileRuns(rcsf) | ||
563 | except CommandError: | 623 | except CommandError: |
564 | pass | 624 | pass |
565 | else: | 625 | |
566 | RunCommand(['rm', '-rf', TMPDIR]) | 626 | RunCommand(['rm', '-rf', TMPDIR]) |
diff --git a/xdelta3/xdelta3.prj b/xdelta3/xdelta3.prj index 4bb85e5..3775204 100755 --- a/xdelta3/xdelta3.prj +++ b/xdelta3/xdelta3.prj | |||
@@ -9,7 +9,7 @@ | |||
9 | (Checkin-Login jmacd) | 9 | (Checkin-Login jmacd) |
10 | (Populate-Ignore ()) | 10 | (Populate-Ignore ()) |
11 | (Project-Keywords | 11 | (Project-Keywords |
12 | (Xdelta3Version "0j") | 12 | (Xdelta3Version "0k") |
13 | (WWWLeftNavBar "<table cellpadding=\"20px\" width=700> <tr> <td class=\"leftbdr\" valign=top height=600 width=100> <div class=\"leftbody\"> <h1>Xdelta</h1> <a href=\"xdelta3.html\">overview</a><br> <a href=\"xdelta3-cmdline.html\">command line</a><br> <a href=\"xdelta3-api-guide.html\">api guide</a><br> <br><a href=\"http://xdelta.org\">xdelta.org</a></h2> </div> </td> <td valign=top width=500>") | 13 | (WWWLeftNavBar "<table cellpadding=\"20px\" width=700> <tr> <td class=\"leftbdr\" valign=top height=600 width=100> <div class=\"leftbody\"> <h1>Xdelta</h1> <a href=\"xdelta3.html\">overview</a><br> <a href=\"xdelta3-cmdline.html\">command line</a><br> <a href=\"xdelta3-api-guide.html\">api guide</a><br> <br><a href=\"http://xdelta.org\">xdelta.org</a></h2> </div> </td> <td valign=top width=500>") |
14 | ) | 14 | ) |
15 | (Files | 15 | (Files |