public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Karsten Blees <karsten.blees@gmail•com>,
	Git List <git@vger•kernel.org>,
	msysGit <msysgit@googlegroups•com>
Subject: Re: [RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands
Date: Wed, 21 May 2014 10:38:13 -0700	[thread overview]
Message-ID: <xmqq1tvnqbga.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140521165508.GC2040@sigill.intra.peff.net> (Jeff King's message of "Wed, 21 May 2014 12:55:08 -0400")

Jeff King <peff@peff•net> writes:

> On Tue, May 20, 2014 at 09:11:24PM +0200, Karsten Blees wrote:
>
>> Add performance tracing to identify which git commands are called and how
>> long they execute. This is particularly useful to debug performance issues
>> of scripted commands.
>> 
>> Usage example: > GIT_TRACE_PERFORMANCE=~/git-trace.log git stash list
>> 
>> Creates a log file like this:
>> performance: at trace.c:319, time: 0.000303280 s: git command: 'git' 'rev-parse' '--git-dir'
>> performance: at trace.c:319, time: 0.000334409 s: git command: 'git' 'rev-parse' '--is-inside-work-tree'
>> performance: at trace.c:319, time: 0.000215243 s: git command: 'git' 'rev-parse' '--show-toplevel'
>> performance: at trace.c:319, time: 0.000410639 s: git command: 'git' 'config' '--get-colorbool' 'color.interactive'
>> performance: at trace.c:319, time: 0.000394077 s: git command: 'git' 'config' '--get-color' 'color.interactive.help' 'red bold'
>> performance: at trace.c:319, time: 0.000280701 s: git command: 'git' 'config' '--get-color' '' 'reset'
>> performance: at trace.c:319, time: 0.000908185 s: git command: 'git' 'rev-parse' '--verify' 'refs/stash'
>> performance: at trace.c:319, time: 0.028827774 s: git command: 'git' 'stash' 'list'
>
> Neat. I actually wanted something like this just yesterday. It looks
> like you are mainly tracing the execution of programs. Would it make
> sense to just tie this to regular trace_* calls, and if
> GIT_TRACE_PERFORMANCE is set, add a timestamp to each line?

Yeah, I very much like both, the output and your suggestion to hook
it into the existing infrastructure.

> Then we would not need to add separate trace_command_performance calls,
> and other parts of the code that are already instrumented with GIT_TRACE
> would get the feature for free.
>
> -Peff
>
> -- 

  reply	other threads:[~2014-05-21 17:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <537BA806.50600@gmail.com>
2014-05-20 19:11 ` [RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues Karsten Blees
2014-05-21  7:31   ` Noel Grandin
2014-05-21  9:14     ` Karsten Blees
2014-05-21 22:14   ` Richard Hansen
2014-05-21 22:17     ` Richard Hansen
2014-05-22  1:33     ` Karsten Blees
2014-05-20 19:11 ` [RFC/PATCH v4 2/3] add trace_performance facility " Karsten Blees
2014-05-21 16:58   ` Jeff King
2014-05-21 18:34     ` Karsten Blees
2014-05-21 20:55       ` Jeff King
2014-05-20 19:11 ` [RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands Karsten Blees
2014-05-21 16:55   ` Jeff King
2014-05-21 17:38     ` Junio C Hamano [this message]
2014-05-22  0:40     ` Karsten Blees
2014-05-22  9:59       ` Jeff King
2014-05-23 14:43         ` Karsten Blees
2014-05-23 20:21           ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1tvnqbga.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=karsten.blees@gmail$(echo .)com \
    --cc=msysgit@googlegroups$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox