]> arthur.barton.de Git - bup.git/commitdiff
hashsplit.py: print performance timings to stderr on exit.
authorAvery Pennarun <apenwarr@gmail.com>
Wed, 30 Dec 2009 06:17:24 +0000 (01:17 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Wed, 30 Dec 2009 06:17:24 +0000 (01:17 -0500)
hashsplit.py

index 351489a009024384aacf08b97944dafcc2bb954a..ba790c61d95eb4271068e7769354abac9bf04a12 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
-import sys, os, subprocess, errno, zlib
+import sys, os, subprocess, errno, zlib, time
 from sha import sha
 
 BLOBBITS = 14
 from sha import sha
 
 BLOBBITS = 14
@@ -109,6 +109,7 @@ def save_blob(blob):
 
 
 def do_main():
 
 
 def do_main():
+    start_time = time.time()
     ofs = 0
     buf = Buf()
     blob = 1
     ofs = 0
     buf = Buf()
     blob = 1
@@ -140,6 +141,9 @@ def do_main():
         if nv != lv:
             log(nv)
             lv = nv
         if nv != lv:
             log(nv)
             lv = nv
+    secs = time.time() - start_time
+    log('\n%.2fkbytes in %.2f secs = %.2f kbytes/sec' 
+        % (ofs/1024., secs, ofs/1024./secs))
 
 
 assert(WINDOWSIZE >= 32)
 
 
 assert(WINDOWSIZE >= 32)