Mercurial > hg
view contrib/macosx/Readme.html @ 32783:4483696dacee
profile: upgrade the "profile" context manager to a full class
So far we have been able to use a simple decorator for this. However using the
current context manager makes the scope of the profiling in dispatch
constrainted and the time frame to decide to enable profiling quite limited
(using "maybeprofile")
This is the first step toward the ability to enable the profiling from within
the profiling scope. eg::
with maybeprofiling(ui) as profiler:
...
bar.foo():
...
if options['profile']:
profiler.start()
...
fooz()
...
My target usecase is adding support for "--profile" to alias definitions with
effect. These are to be used with "profiling.output=blackbox" to gather data
about operation that get slow from time to time (eg: pull being minutes instead
of seconds from time to time).
Of course, in such case, the scope of the profiling would be smaller since
profiler would be started after running extensions 'reposetup' (and other
potentially costly logic), but these are not relevant for my target usecase
(multiple second commits, multiple tens of seconds pull).
Currently adding '--profile' to a command through alias requires to re-spin a
Mercurial binary (using "!$HG" in alias), which as a significant performance
impact, especially in context where startup performance is being worked on...
An alternative approach would be to stop using the context manager in dispatch
and move back to a try/finally setup.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Jun 2017 01:38:48 +0100 |
parents | 2fd3549c8a5f |
children | 76ba5b5a53f0 |
line wrap: on
line source
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!-- This is the second screen displayed during the install. --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>Read Me - Important Information</title> <style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #000fed} span.s1 {text-decoration: underline} span.s2 {font: 12.0px Courier} </style> </head> <body> <p class="p1"><b>Before you install</b></p> <p class="p2"><br></p> <p class="p3">This is an OS X version of Mercurial that depends on the default Python installation.</p> <p class="p2"><br></p> <p class="p1"><b>After you install</b></p> <p class="p2"><br></p> <p class="p3">This package installs the <span class="s2">hg</span> executable as <span class="s2">/usr/local/bin/hg</span>. See <span class="s2">hg debuginstall</span> for more info on file locations.</p> <p class="p2"><br></p> <p class="p1"><b>Documentation</b></p> <p class="p2"><br></p> <p class="p3">Visit the <a href="https://mercurial-scm.org/">Mercurial web site and wiki</a></p> <p class="p2"><br></p> <p class="p3">There's also a free book, <a href="http://hgbook.red-bean.com/">Distributed revision control with Mercurial</a></p> <p class="p2"><br></p> <p class="p1"><b>Reporting problems</b></p> <p class="p2"><br></p> <p class="p3">If you run into any problems, please file a bug online:</p> <p class="p3"><a href="https://bz.mercurial-scm.org/">https://bz.mercurial-scm.org/</a></p> </body> </html>