[MERGE] is_ignored benchmarks..

Robert Collins robertc at robertcollins.net
Sun Jun 11 08:33:01 BST 2006


Seeking a +1 on the benchmarks.


This patch has some interesting timing data:

if you run just is_ignored_single_call something like:
test_is_ignored_single_call OK   144ms/  272ms

if you run both:
test_is_ignored_10824_calls OK  1704ms/ 1833ms
test_is_ignored_single_call OK    26ms/   92ms


From this it looks like:
120ms of is_ignored's cost is static overhead - imports etc [but may be
a caching effect in the regex engine]
26ms is the time to compile and run our default ignores after that.
1560ms is the time to to 10K ignores - or 15ms to evaluate a single
ignore.

If I drop the default ignores to an empty list:
test_is_ignored_single_call OK     3ms/  131ms

and

test_is_ignored_10824_calls OK   154ms/  285ms
test_is_ignored_single_call OK     0ms/   64ms

so the overhead to process an empty list is 1/10 the time to process a
list of ~50.

With a list of one glob match:

test_is_ignored_single_call OK     5ms/  146ms

and:
test_is_ignored_10824_calls OK   105ms/  177ms
test_is_ignored_single_call OK     0ms/   33ms


So there seems to be some pertubation in here.

I started looking at this because I wondered how much of our 2 seconds
for the 10K tree add case was being spent usefully ;).

Rob



=== modified file 'bzrlib/benchmarks/bench_workingtree.py'
--- bzrlib/benchmarks/bench_workingtree.py      2006-05-30 04:33:16
+0000                                                                                    
+++ bzrlib/benchmarks/bench_workingtree.py      2006-06-11 07:18:19
+0000
@@ -43,3 +43,15 @@
             tree.add(root)
         self.time(list, tree.list_files())
 
+    def test_is_ignored_single_call(self):
+        """How long does is_ignored take to initialise and check one
file."""
+        t = self.make_branch_and_tree('.')
+        self.time(t.is_ignored, "CVS")
+        
+    def test_is_ignored_10824_calls(self):
+        """How long does is_ignored take to initialise and check one
file."""
+        t = self.make_branch_and_tree('.')
+        def call_is_ignored_10824_not_ignored():
+            for x in xrange(10824):
+                t.is_ignored(str(x))
+        self.time(call_is_ignored_10824_not_ignored)



-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060611/4119f9d6/attachment.pgp 


More information about the bazaar mailing list