~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to profile_imports.py

  • Committer: John Arbash Meinel
  • Date: 2006-06-18 04:48:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1794.
  • Revision ID: john@arbash-meinel.com-20060618044838-9ecf14ee3d0a1f18
Default to hiding things that take less that .1ms to keep the output clean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
    _info[this].append(cost)
69
69
 
70
70
 
71
 
def log_stack_info(out_file, sorted=True):
 
71
def log_stack_info(out_file, sorted=True, hide_fast=True):
72
72
    # Find all of the roots with import = 0
73
 
    out_file.write('cum   inline name\t\t\tscope\t\t\tframe\n')
 
73
    out_file.write(' cum  inline name\t\t\t\t\t\tframe\n')
74
74
    todo = [(value[-1], key) for key,value in _info.iteritems() if value[0] == 0]
75
75
 
76
76
    if sorted:
83
83
        c_times = []
84
84
 
85
85
        info = _info[cur]
 
86
        if hide_fast and info[-1] < 0.0001:
 
87
            continue
 
88
 
86
89
        # Compute the module time by removing the children times
87
90
        mod_time = info[-1]
88
91
        for child in children: