On Wed, Feb 15, 2017 at 10:43 AM, Bryan O'Sullivan <b...@serpentine.com> wrote:
> On Tue, Feb 14, 2017 at 7:02 PM, Gregory Szorc <gregory.sz...@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! > OK, you caught me: I only glanced at your patches ;) I look forward to seeing this feature patchbombed!
_______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel