# # # add_file "README" # content [b913e6cdc2eec97224ec7f8297b9e44783b10781] # # patch "mtn_benchmark/benchmarks.py" # from [eac99c9560e08ad74e48df5ec8e3821cc6691409] # to [27e5079920b8abad19ad7bad2a2153a385a57014] # # patch "mtn_benchmark/cmdline.py" # from [e3984bf55a163e82c7f7125b456d9c2a46ff9829] # to [38b357a13605cb49d738238fdb2f5764b6518bec] # # patch "mtn_benchmark/driver.py" # from [7c413d6c2f6ed9ce66eed22591636743a63b15e3] # to [d3d4addd727eb4b27ce0191225959b61082d8ec5] # ============================================================ --- README b913e6cdc2eec97224ec7f8297b9e44783b10781 +++ README b913e6cdc2eec97224ec7f8297b9e44783b10781 @@ -0,0 +1,42 @@ +Try: + +If on linux 2.6.16: +$ gcc drop_caches.c -o drop_caches +$ sudo chown root.root drop_caches +$ sudo chmod u+s drop_caches +Otherwise, enhance drop_caches to work on your platform, or do +without. + +Then: +$ python2.4 benchmark.py \ + -m mtn-0.26=path/to/0.26 -m mtn-0.27=path/to/0.27 \ + -b pull='Pull(ExistingRepo("path/to/some/repo.mtn"))' \ + myscratch myresults + +Then look in myresults/. + + +Add new instrumenters (oprofile, callgrind, massif, dtrace IO tracing, +...) to instrumenters.py. + +Add implementations of the mtn.py interface backed against, say, hg +and git, in new files, to do side-by-side comparisons (use the -v +switch, which is a more general form of -m). + +Add ways to generate synthetic histories to repo.py, so we can stop +screwing around with stupid arbitrary test databases that can't be +varied systematically (even in size!) or compared between people. + +Add new benchmarks to benchmarks.py. This probably will require +enhancing mtn.py. Workspace benchmarks are needed too, and should get +an abstract interface like repo.py. + +Extra points: implement some sort of caching mechanism or something, +to reduce the amount of copying of large files required. + + + + +Oh yeah -- Copyright (C) 2006, Nathaniel Smith . +Licensed under the terms of the GNU GPL v2, or, at your option, any +later version. ============================================================ --- mtn_benchmark/benchmarks.py eac99c9560e08ad74e48df5ec8e3821cc6691409 +++ mtn_benchmark/benchmarks.py 27e5079920b8abad19ad7bad2a2153a385a57014 @@ -11,7 +11,7 @@ # copy of it). My testable may or may not be identical. pass -class PullBenchmark(object): +class Pull(object): def __init__(self, repo_source): self.repo_source = repo_source ============================================================ --- mtn_benchmark/cmdline.py e3984bf55a163e82c7f7125b456d9c2a46ff9829 +++ mtn_benchmark/cmdline.py 38b357a13605cb49d738238fdb2f5764b6518bec @@ -102,18 +102,3 @@ if __name__ == "__main__": import sys main(sys.argv[0], sys.argv[1:]) - -def tryit(): - scratch = "scratch" - results = "results" - shutil.rmtree(scratch, True) - shutil.rmtree(results, True) - - testables = {"mtn": Mtn("/home/njs/src/monotone/opt/mtn")} - benchmarks = {"pull": PullBenchmark(ExistingRepo("/home/njs/src/monotone/benchmark/test.mtn"))} - instrumenters = {"time": TimingInstrumenter(2)} - debug = 1 - - cache_clearer = CacheClearer("/home/njs/src/monotone/benchmark/drop_caches") - - ============================================================ --- mtn_benchmark/driver.py 7c413d6c2f6ed9ce66eed22591636743a63b15e3 +++ mtn_benchmark/driver.py d3d4addd727eb4b27ce0191225959b61082d8ec5 @@ -17,7 +17,6 @@ self.cache_clearer = cache_clearer def run(self): - startdir = os.getcwd() for benchmark_name, benchmark_obj in self.benchmarks.iteritems(): benchdir = os.path.join(self.scratch, benchmark_name) @@ -58,10 +57,12 @@ benchmark_obj.run(testable) instrumenter_obj.flush() if not self.debug: - os.chdir(startdir) shutil.rmtree(rundir) - if not self.debug: - for testable_name in self.testables.iterkeys(): - shutil.rmtree(os.path.join(benchdir, "setup-" + testable_name)) + if not self.debug: + for testable_name in self.testables.iterkeys(): + shutil.rmtree(os.path.join(benchdir, "setup-" + testable_name)) + + if not self.debug: + shutil.rmtree(self.scratch)