Chrome tracing

Bryan O'Sullivan bos at serpentine.com
Wed Feb 15 13:43:47 EST 2017


On Tue, Feb 14, 2017 at 7:02 PM, Gregory Szorc <gregory.szorc at gmail.com>
wrote:

>
> I support having dedicated code for annotating well-defined and important
> Mercurial operations in tracing/profiling logs. I have a hunch that the
> kinds of things we need to annotate shouldn't be called with a high enough
> frequency for probe overhead to matter.
>

Right.


> But if it does, the use of context managers can be beneficial, as those
> are evaluated at module load time and the context manager can be made to
> no-op and return the original function unless tracing is enabled. That's
> *almost* 0 cost.
>

That's exactly what the implementation does :-)


> Something else to consider is the interaction between tracing and progress
> bars. I posit that most places we use progress bars are places we'd want to
> use the proposed tracing.duration() context manager. I reckon we could
> integrate tracing into the progress APIs and kill 2 birds with 1 stone.
>

That's again almost exactly what the implementation does, but it uses the
Chrome trace feature of tracking a numeric quantity instead. It's like you
read my mind ... or the patches!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170215/622e6250/attachment.html>


More information about the Mercurial-devel mailing list