~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/bench_xml.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 22:00:19 UTC
  • mto: This revision was merged to the branch mainline in revision 1942.
  • Revision ID: john@arbash-meinel.com-20060816220019-541cb90093258ac3
Using real utf8 and cache_utf8 has similar performance, 272ms, and 363ms

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
"""Tests for bzr xml serialization performance."""
17
17
 
18
18
from bzrlib import (
 
19
    cache_utf8,
19
20
    xml5,
20
21
    )
21
22
from bzrlib.benchmarks import Benchmark
33
34
        #              cached, passing around function:   328ms/11248ms
34
35
        #                      removing extra function:   354ms/ 8942ms
35
36
        #              cached, removing extra function:   275ms/11248ms
 
37
        #                          no cache, real utf8:   363ms/11697ms
 
38
        #                            cached, real utf8:   272ms/12827ms
36
39
        # Really all we want is a real inventory
37
40
        tree = self.make_kernel_like_committed_tree('.', link_bzr=True)
38
41
 
64
67
 
65
68
        self.time(xml5.serializer_v5.write_inventory_to_string, inv)
66
69
 
 
70
    def test_serialize_to_string_no_cache_kernel_like_inventory(self):
 
71
        tree = self.make_kernel_like_committed_tree('.', link_bzr=True)
 
72
 
 
73
        cache_utf8.clear_encoding_cache()
 
74
        xml5._clear_cache()
 
75
        # We want a real tree with lots of file ids and sha strings, etc.
 
76
        inv = tree.basis_tree().inventory
 
77
        self.time(xml5.serializer_v5.write_inventory_to_string, inv)
 
78