How to examine performance bottlenecks: profile data --help

Jari Aalto jari.aalto at cante.net
Sun Jan 20 23:04:45 GMT 2008


* Sun 2008-01-20 John Arbash Meinel <john at arbash-meinel.com>
* Message-Id: 47938A25.4090100 at arbash-meinel.com
> Jari Aalto wrote:
>
>> Is there a wiki page that lists how to study the performance
>> bottlenecks? 
>>
>> See this: (1.0.0 / Cygwin): (Mercurial 3s)
>>
>>     $ time bzr --version
>>     real    0m16.830s
>>     user    0m2.673s
>>     sys     0m8.091s
>
> bzr --profile-imports COMMAND

Here are results. How would you like me to post other results? Any
specific Subject?

Jari

Bazaar (bzr) 1.2.0.dev.0

 cum  inline name                                               frame
2446.2  27.0  bzrlib                                    @ __main__:64
1361.2 204.2 +  [get_user_encoding]bzrlib.osutils       @ bzrlib:19
562.0  22.0 ++  [mutter]bzrlib.trace                    @ bzrlib.osutils:62
530.0  48.0 +++ logging                                 @ bzrlib.trace:54
191.0 114.0 ++++ string                                 @ logging:29
 77.0  77.0 +++++  [maketrans, lowercase, uppercase,    @ string:526
189.0  78.0 ++++ threading                              @ logging:38
111.0 111.0 +++++  [deque]collections                   @ threading:13
 32.0  32.0 ++++ traceback                              @ logging:29
 22.0  22.0 ++++ atexit                                 @ logging:1363
 18.0  18.0 ++++ sys                                    @ logging:29
  8.0   8.0 ++++ types                                  @ logging:29
  5.0   5.0 ++++ codecs                                 @ logging:32
  5.0   5.0 ++++ thread                                 @ logging:37
  5.0   5.0 ++++ cStringIO                              @ logging:29
  4.0   4.0 ++++ os                                     @ logging:29
  3.0   3.0 ++++ time                                   @ logging:29
 10.0  10.0 +++ codecs                                  @ bzrlib.trace:53
335.0  15.0 ++ [l]  [win32utils]bzrlib                  @ bzrlib.osutils:319
187.0 101.0 +++ ctypes                                  @ bzrlib.win32utils:56
 55.0  55.0 ++++  [Union, Structure, Array]_ctypes      @ ctypes:10
 18.0  18.0 ++++  [BigEndianStructure, LittleEndianS    @ ctypes:516
  6.0   6.0 ++++ os                                     @ ctypes:6
  3.0   3.0 ++++  [calcsize]struct                      @ ctypes:17
  3.0   3.0 ++++ sys                                    @ ctypes:6
  1.0   1.0 ++++  [_wstring_at_addr]_ctypes             @ ctypes:488
 78.0  32.0 +++ struct                                  @ bzrlib.win32utils:23
 46.0  46.0 ++++  [Struct, error]_struct                @ struct:30
 55.0  55.0 +++ win32file                               @ bzrlib.win32utils:68
104.0  31.0 ++ [l] sha                                  @ bzrlib.osutils:613
 73.0  24.0 +++  [sha1]hashlib                          @ sha:6
 49.0  49.0 ++++ _hashlib                               @ hashlib:102
 56.0  56.0 ++  [StringIO]cStringIO                     @ bzrlib.osutils:17
 27.0  13.0 ++  [symbol_versioning]bzrlib               @ bzrlib.osutils:57
 14.0  14.0 +++  [warn]warnings                         @ bzrlib.symbol_versioning:49
 23.0  23.0 ++  [lazy_import]bzrlib.lazy_import         @ bzrlib.osutils:26
 11.0  11.0 ++ sys                                      @ bzrlib.osutils:23
 10.0  10.0 ++ time                                     @ bzrlib.osutils:24
 10.0  10.0 ++ stat                                     @ bzrlib.osutils:20
 10.0  10.0 ++ re                                       @ bzrlib.osutils:19
  9.0   9.0 ++ os                                       @ bzrlib.osutils:18
868.0  23.0 + [l]  [config]bzrlib                       @ bzrlib.plugin:60
844.0 270.0 ++ [l]  [configobj]bzrlib.util.configo      @ bzrlib.config:125
461.0  25.0 +++ compiler                                @ bzrlib.util.configobj.configobj:29
220.0  38.0 ++++  [compile, compileFile]compiler.pyc    @ compiler:26
140.0  46.0 +++++  [pyassem, misc, future, symbols]co   @ compiler.pycodegen:9
 55.0  27.0 ++++++ dis                                  @ compiler.pyassem:3
 28.0  28.0 +++++++  [*]opcode                          @ dis:6
 27.0  26.0 ++++++ new                                  @ compiler.pyassem:4
  1.0   1.0 +++++++  [MethodType]types                  @ new:10
  8.0   8.0 ++++++  [misc]compiler                      @ compiler.pyassem:7
  4.0   4.0 ++++++ types                                @ compiler.symbols:6
 13.0  13.0 +++++ imp                                   @ compiler.pycodegen:1
  9.0   9.0 +++++  [ast, parse, walk, syntax]compiler   @ compiler.pycodegen:8
  6.0   6.0 +++++ struct                                @ compiler.pycodegen:4
  6.0   6.0 +++++ os                                    @ compiler.pycodegen:2
  4.0   4.0 +++++  [StringIO]cStringIO                  @ compiler.pycodegen:6
  4.0   4.0 +++++ marshal                               @ compiler.pycodegen:3
209.0  26.0 ++++  [parse, parseFile]compiler.transfo    @ compiler:24
 65.0  58.0 +++++  [*]compiler.ast                      @ compiler.transformer:28
  7.0   7.0 ++++++  [CO_VARARGS, CO_VARKEYWORDS]compil  @ compiler.ast:5
 53.0  53.0 +++++ parser                                @ compiler.transformer:29
 33.0  33.0 +++++ symbol                                @ compiler.transformer:30
 29.0  29.0 +++++ token                                 @ compiler.transformer:31
  3.0   3.0 +++++ sys                                   @ compiler.transformer:32
  7.0   6.0 ++++  [walk]compiler.visitor                @ compiler:25
  1.0   1.0 +++++  [ast]compiler                        @ compiler.visitor:1
 50.0  50.0 +++  [VdtMissingValue]validate              @ bzrlib.util.configobj.configobj:92
 30.0  30.0 +++  [generators]__future__                 @ bzrlib.util.configobj.configobj:19
  7.0   7.0 +++  [warn]warnings                         @ bzrlib.util.configobj.configobj:34
  5.0   5.0 +++  [BOM_UTF8, BOM_UTF16, BOM_UTF16_BE     @ bzrlib.util.configobj.configobj:36
  5.0   5.0 +++ os                                      @ bzrlib.util.configobj.configobj:26
  5.0   5.0 +++  [StringTypes]types                     @ bzrlib.util.configobj.configobj:33
  5.0   5.0 +++ re                                      @ bzrlib.util.configobj.configobj:26
  5.0   5.0 +++ sys                                     @ bzrlib.util.configobj.configobj:21
  1.0   1.0 +++ sre_parse                               @ sre_compile:505
  1.0   1.0 ++ sys                                      @ bzrlib.config:66
161.0  53.0 + locale                                    @ bzrlib.osutils:1354
 55.0  55.0 ++ operator                                 @ locale:165
 53.0  53.0 ++  [*]_locale                              @ locale:28
 17.0  16.0 + bzrlib.plugin                             @ bzrlib:50
  1.0   1.0 ++  [deprecated_function, zero_ninetyo      @ bzrlib.plugin:49
 12.0  12.0 + [l]  [plugins]bzrlib                      @ bzrlib.plugin:107
1512.0  31.0   [RepositoryFormatKnit1]bzrlib.repo       @ bzrlib.registry:66
1343.0 104.0 +  [bzrdir, deprecated_graph, errors,      @ bzrlib.repofmt.knitrepo:25
736.0  86.0 ++  [cache_utf8, debug, diff, errors,       @ bzrlib.knit:82
388.0  37.0 +++  [TransformPreview, TreeTransform,      @ bzrlib.merge:51
350.0 109.0 ++++ tempfile                               @ bzrlib.transform:20
200.0  71.0 +++++  [Random]random                       @ tempfile:33
 45.0  45.0 ++++++  [log, exp, pi, e, ceil]math         @ random:43
 42.0  42.0 ++++++ _random                              @ random:67
 42.0  42.0 ++++++  [hexlify]binascii                   @ random:46
 41.0  41.0 +++++ fcntl                                 @ tempfile:40
  1.0   1.0 ++++ errno                                  @ bzrlib.transform:18
107.0  40.0 +++ difflib                                 @ bzrlib.diff:17
 67.0  25.0 ++++ heapq                                  @ difflib:35
 42.0  42.0 +++++  [heappush, heappop, heapify, heapr   @ heapq:307
 38.0  20.0 +++  [Merge3]bzrlib.merge3                  @ bzrlib.merge:45
 18.0  18.0 ++++  [check_text_lines]bzrlib.textfile     @ bzrlib.merge3:24
 34.0  34.0 +++ shutil                                  @ bzrlib.diff:20
 33.0  17.0 +++  [PlanWeaveMerge]bzrlib.versionedfi     @ bzrlib.merge:55
 15.0  15.0 ++++  [TextMerge]bzrlib.textmerge           @ bzrlib.versionedfile:39
  1.0   1.0 ++++  [StringIO]cStringIO                   @ bzrlib.versionedfile:36
 19.0  19.0 +++  [unique_lcs_py, recurse_matches_py     @ bzrlib.patiencediff:133
 17.0  17.0 +++ errno                                   @ bzrlib.merge:19
 13.0  13.0 +++  [unique_lcs_c, recurse_matches_c,      @ bzrlib.patiencediff:127
  1.0   1.0 +++  [lazy_import]bzrlib.lazy_import        @ bzrlib.diff:23
308.0  16.0 ++  [SubElement, Element, Serializer]b      @ bzrlib.xml5:26
291.0  70.0 +++  [ElementTree, SubElement, Element,     @ bzrlib.xml_serializer:31
163.0  72.0 ++++  [*]_elementtree                       @ xml.etree.cElementTree:3
 51.0  13.0 +++++  [ElementTree]xml.etree               @ <unknown>:3
 23.0  23.0 ++++++ ElementPath                          @ xml.etree.ElementTree:136
  7.0   7.0 ++++++ string                               @ xml.etree.ElementTree:112
  4.0   4.0 ++++++ re                                   @ xml.etree.ElementTree:112
  4.0   4.0 ++++++ sys                                  @ xml.etree.ElementTree:112
 39.0  39.0 +++++  [__doc__]pyexpat                     @ profile_imports:137
  1.0   1.0 +++++  [copy, deepcopy]copy                 @ <unknown>:1
 58.0  58.0 ++++ _xmlplus                               @ xml:32
  1.0   1.0 +++  [registry]bzrlib                       @ bzrlib.xml_serializer:25
 84.0  84.0 ++  [Z_DEFAULT_COMPRESSION]zlib             @ bzrlib.knit:70
 48.0  18.0 ++  [GzipFile, bytes_to_gzip]bzrlib.tu      @ bzrlib.knit:103
 30.0  28.0 +++ gzip                                    @ bzrlib.tuned_gzip:23
  2.0   2.0 ++++ struct                                 @ gzip:8
 33.0  18.0 ++ bzrlib.weave                             @ bzrlib.knit:113
 13.0  13.0 +++  [_read_weave_v5, write_weave_v5]bz     @ bzrlib.weave:93
  1.0   1.0 +++ bzrlib.patiencediff                     @ bzrlib.weave:90
  1.0   1.0 +++  [mutter]bzrlib.trace                   @ bzrlib.weave:81
 11.0  11.0 ++  [_load_data_py]bzrlib._knit_load_d      @ bzrlib.knit:2694
 10.0  10.0 ++  [_load_data_c]bzrlib._knit_load_da      @ bzrlib.knit:2692
  9.0   9.0 ++ operator                                 @ bzrlib.knit:66
120.0  35.0 +  [VersionedFileStore]bzrlib.store.v       @ bzrlib.repofmt.knitrepo:49
 21.0  21.0 ++  [AtomicFile]bzrlib.atomicfile           @ bzrlib.store.versioned:34
  8.0   8.0 ++ errno                                    @ bzrlib.store.versioned:21
  7.0   7.0 ++ os                                       @ bzrlib.store:27
  6.0   6.0 ++ bzrlib                                   @ bzrlib.store:32
  6.0   6.0 ++  [StringIO]cStringIO                     @ bzrlib.store:28
  6.0   6.0 ++ urllib                                   @ bzrlib.store:29
  5.0   5.0 ++  [errors, osutils]bzrlib                 @ bzrlib.store.versioned:27
  5.0   5.0 ++ urllib                                   @ bzrlib.store.versioned:24
  5.0   5.0 ++  [warn]warnings                          @ bzrlib.store.versioned:25
  5.0   5.0 ++ os                                       @ bzrlib.store.versioned:22
  4.0   4.0 ++  [adler32]zlib                           @ bzrlib.store:30
  4.0   4.0 ++  [StringIO]cStringIO                     @ bzrlib.store.versioned:23
  2.0   2.0 ++  [TransportStore]bzrlib.store            @ bzrlib.store.versioned:33
  1.0   1.0 ++  [errors, osutils, symbol_versionin      @ bzrlib.store:33
 13.0   8.0 +  [bencode]bzrlib.util                     @ bzrlib.repofmt.knitrepo:51
  5.0   5.0 ++  [StringType, IntType, LongType, Di      @ bzrlib.util.bencode:93
  5.0   5.0 +  [lazy_import]bzrlib.lazy_import          @ bzrlib.repofmt.knitrepo:17
761.0  82.0   [cmd_version]bzrlib.builtins              @ bzrlib.commands:728
424.0  50.0 + [l]  [bzrdir]bzrlib                       @ bzrlib.builtins:1290
203.0  36.0 ++ [l]  [lockable_files]bzrlib              @ bzrlib.bzrdir:1621
 87.0  50.0 +++ bzrlib.transactions                     @ bzrlib.lockable_files:30
 37.0  37.0 ++++  [IdentityMap, NullIdentityMap]bzrl    @ bzrlib.transactions:42
 80.0  80.0 +++ bzrlib.urlutils                         @ bzrlib.lockable_files:31
124.0  57.0 ++  [LocalTransport]bzrlib.transport.l      @ bzrlib.bzrdir:79
 31.0  31.0 +++ [l] urlparse                            @ bzrlib.transport:164
  9.0   9.0 +++  [StringIO]cStringIO                    @ bzrlib.transport:29
  7.0   7.0 +++  [lazy_import]bzrlib.lazy_import        @ bzrlib.transport:33
  6.0   6.0 +++ os                                      @ bzrlib.transport.local:22
  5.0   5.0 +++ re                                      @ bzrlib.transport:30
  5.0   5.0 +++ sys                                     @ bzrlib.transport:31
  3.0   3.0 +++  [ST_MODE, S_ISDIR, ST_SIZE, S_IMOD     @ bzrlib.transport.local:23
  1.0   1.0 +++  [note, mutter, warning]bzrlib.trac     @ bzrlib.transport:61
 46.0  15.0 ++ [l]  [lockdir]bzrlib                     @ bzrlib.bzrdir:1790
 30.0  16.0 +++  [read_stanza, Stanza]bzrlib.rio        @ bzrlib.lockdir:132
 14.0  14.0 ++++  [IterableFile]bzrlib.iterablefile     @ bzrlib.rio:35
  1.0   1.0 +++  [StringIO]cStringIO                    @ bzrlib.lockdir:108
  1.0   1.0 ++ os                                       @ bzrlib.bzrdir:31
 66.0  34.0 +  [cmd_version_info]bzrlib.cmd_versi       @ bzrlib.builtins:4470
 32.0  18.0 ++  [version_info_formats]bzrlib            @ bzrlib.cmd_version_info:27
 10.0  10.0 +++ time                                    @ bzrlib.version_info_formats:19
  4.0   4.0 +++  [local_time_offset, format_date]bz     @ bzrlib.version_info_formats:21
 57.0  34.0 +  [cmd_bundle_info]bzrlib.bundle.com       @ bzrlib.builtins:4472
  8.0   8.0 ++  [StringIO]StringIO                      @ bzrlib.bundle:17
  5.0   5.0 ++  [StringIO]cStringIO                     @ bzrlib.bundle.commands:24
  5.0   5.0 ++ sys                                      @ bzrlib.bundle.commands:23
  5.0   5.0 ++  [lazy_import]bzrlib.lazy_import         @ bzrlib.bundle:19
 54.0  54.0 +  [StringIO]StringIO                       @ bzrlib.builtins:20
 29.0  26.0 +  [cmd_versionedfile_list, cmd_weave       @ bzrlib.builtins:4476
  3.0   3.0 ++  [Command]bzrlib.commands                @ bzrlib.weave_commands:25
 24.0  24.0 +  [cmd_resolve, cmd_conflicts, resto       @ bzrlib.builtins:4471
 23.0  22.0 +  [cmd_sign_my_commits]bzrlib.sign_m       @ bzrlib.builtins:4475
  1.0   1.0 ++  [Option]bzrlib.option                   @ bzrlib.sign_my_commits:29
  1.0   1.0 + copy                                      @ bzrlib.option:415
  1.0   1.0 +  [ListOption, Option, RegistryOptio       @ bzrlib.builtins:58
698.0  22.0  bzrlib.commands                            @ __main__:96
676.0  19.0 +  [Option]bzrlib.option                    @ bzrlib.commands:56
505.0  51.0 ++ [l]  [log]bzrlib                         @ bzrlib.option:526
179.0 157.0 +++  [BzrCommandError]bzrlib.errors         @ bzrlib.log:68
 22.0  22.0 ++++  [MalformedHunkHeader, MalformedLin    @ bzrlib.errors:25
158.0  20.0 +++  [RevisionInfo]bzrlib.revisionspec      @ bzrlib.log:79
 75.0  32.0 ++++ bisect                                 @ bzrlib.revisionspec:18
 43.0  43.0 +++++  [bisect_right, bisect_left, insort   @ bisect:82
 63.0  63.0 ++++ datetime                               @ bzrlib.revisionspec:19
 63.0  17.0 +++  [NULL_REVISION]bzrlib.revision         @ bzrlib.log:76
 26.0  12.0 ++++  [all_descendants, Graph, node_dist    @ bzrlib.revision:25
 14.0  14.0 +++++  [topo_sort]bzrlib.tsort              @ bzrlib.deprecated_graph:18
 20.0  19.0 ++++  [DummyProgress]bzrlib.progress        @ bzrlib.revision:32
  1.0   1.0 +++++ os                                    @ bzrlib.progress:40
 54.0  54.0 +++  [izip]itertools                        @ bzrlib.log:53
138.0  87.0 ++ [l] optparse                             @ bzrlib.option:394
 26.0  25.0 +++ textwrap                                @ optparse:71
  1.0   1.0 ++++ string                                 @ textwrap:10
 25.0  24.0 +++  [gettext]gettext                       @ optparse:84
  1.0   1.0 ++++  [ENOENT]errno                         @ gettext:50
 14.0  14.0 ++ [l]  [registry]bzrlib                    @ bzrlib.option:437
255.0  23.0  [l]  [dirstate]bzrlib                      @ bzrlib.workingtree_4:270
138.0  17.0 +  [cache_utf8, debug, errors, invent       @ bzrlib.dirstate:214
 56.0  56.0 ++ msvcrt                                   @ bzrlib.lock:97
 55.0  55.0 ++ win32con                                 @ bzrlib.lock:92
  9.0   9.0 ++ fcntl                                    @ bzrlib.lock:87
  1.0   1.0 ++ sys                                      @ bzrlib.lock:38
 48.0  48.0 +  [_read_dirblocks_py, bisect_dirblo       @ bzrlib.dirstate:2666
 35.0  35.0 +  [_read_dirblocks_c, bisect_dirbloc       @ bzrlib.dirstate:2658
 11.0  11.0 + binascii                                  @ bzrlib.dirstate:204
232.0  77.0   [WorkingTreeFormat]bzrlib.workingt        @ bzrlib.bzrdir:1360
 81.0  18.0 + bzrlib.mutabletree                        @ bzrlib.workingtree:90
 63.0  23.0 ++  [errors, osutils, tree]bzrlib           @ bzrlib.mutabletree:36
 16.0  16.0 +++  [delta, osutils, revision, conflic     @ bzrlib.tree:25
 13.0  13.0 +++  [InterObject]bzrlib.inter              @ bzrlib.tree:36
 10.0  10.0 +++  [deque]collections                     @ bzrlib.tree:21
  1.0   1.0 +++  [Inventory, InventoryFile]bzrlib.i     @ bzrlib.tree:35
 46.0  42.0 + [l]  [WorkingTreeFormat4]bzrlib.wor       @ bzrlib.workingtree:2949
  1.0   1.0 ++ [l]  [osutils]bzrlib                     @ bzrlib.workingtree_4:478
  1.0   1.0 ++  [Tree]bzrlib.tree                       @ bzrlib.workingtree_4:97
  1.0   1.0 ++  [LocalTransport]bzrlib.transport.l      @ bzrlib.workingtree_4:87
  1.0   1.0 ++  [needs_read_lock, needs_write_lock      @ bzrlib.workingtree_4:70
 28.0  28.0 +  [InventoryEntry, Inventory, ROOT_I       @ bzrlib.workingtree:87
232.0  63.0  [l] urllib                                 @ bzrlib.urlutils:70
169.0  48.0 + socket                                    @ urllib:26
 66.0  66.0 ++ _ssl                                     @ socket:50
 55.0  55.0 ++ _socket                                  @ socket:45
 75.0  33.0  copy                                       @ bzrlib.inspect_for_copy:72
 42.0  42.0 +  [PyStringMap]org.python.core             @ copy:59
 66.0  12.0   [show_version]bzrlib.version              @ bzrlib.builtins:2682
 53.0  40.0 +  [Branch]bzrlib.branch                    @ bzrlib.version:30
 13.0  13.0 ++  [Hooks]bzrlib.hooks                     @ bzrlib.branch:57
  1.0   1.0 + sys                                       @ bzrlib.version:20
 53.0  53.0   [RepositoryFormat]bzrlib.repositor        @ bzrlib.bzrdir:1352
 41.0  27.0  [l]  [KnitRevisionStore]bzrlib.stor        @ bzrlib.repofmt.knitrepo:381
  8.0   8.0 +  [StringIO]cStringIO                      @ bzrlib.store.revision:24
  6.0   6.0 +  [lazy_import]bzrlib.lazy_import          @ bzrlib.store.revision:26
 33.0  33.0  [l]  [fnmatch]fnmatch                      @ bzrlib.config:499
 27.0  16.0  bzrlib.ui                                  @ bzrlib.commands:789
  7.0   7.0 + sys                                       @ bzrlib.ui:31
  4.0   4.0 +  [lazy_import]bzrlib.lazy_import          @ bzrlib.ui:33
 24.0  14.0  bzrlib.breakin                             @ __main__:84
 10.0  10.0 + signal                                    @ bzrlib.breakin:18
 15.0  15.0   [*]encodings.utf_8                        @ encodings:97
 15.0  15.0  [l]  [DisabledTags]bzrlib.tag              @ bzrlib.branch:99
 13.0  13.0  [l]  [debug]bzrlib                         @ bzrlib.trace:132
 13.0  13.0  bzrlib.decorators                          @ __main__:87
 11.0  11.0   [TextUIFactory]bzrlib.ui.text             @ bzrlib.commands:790
 11.0  11.0  bzrlib.lazy_regex                          @ __main__:81
 10.0  10.0  bzrlib.inspect_for_copy                    @ __main__:78
  9.0   9.0  [l] posixpath                              @ bzrlib.osutils:266
  4.0   4.0  [l] errno                                  @ bzrlib.transport.local:146
  1.0   1.0  os                                         @ fnmatch:35
  1.0   1.0   [BranchFormat]bzrlib.branch               @ bzrlib.bzrdir:1255
  1.0   1.0  [l]  [errors]bzrlib                        @ bzrlib.transport:624
  1.0   1.0  bzrlib.urlutils                            @ bzrlib.errors:602
  1.0   1.0  bzrlib.urlutils                            @ bzrlib.errors:602
  1.0   1.0  [l] codecs                                 @ bzrlib.commands:452
  1.0   1.0  stat                                       @ bzrlib.trace:161



-- 
Welcome to FOSS revolution: we fix and modify until it shines




More information about the bazaar mailing list