Re: [PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-18 Thread Junio C Hamano
Karsten Blees writes: > Right, it makes no sense for trace_performance(), and for > trace_performance_since() only if followed by another 'measured' code > section. In that special case, I think it wouldn't hurt if you had to > write: > > uint64_t start = getnanotime(); > /* first code sectio

Re: [PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-18 Thread Karsten Blees
Am 17.06.2014 19:11, schrieb Junio C Hamano: > Karsten Blees writes: > >> Simple use case (measure one code section): >> >> uint64_t start = getnanotime(); >> /* code section to measure */ >> trace_performance_since(start, "foobar"); >> >> Medium use case (measure consecutive code sections)

Re: [PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-17 Thread Junio C Hamano
Karsten Blees writes: > Simple use case (measure one code section): > > uint64_t start = getnanotime(); > /* code section to measure */ > trace_performance_since(start, "foobar"); > > Medium use case (measure consecutive code sections): > > uint64_t start = getnanotime(); > /* first cod

[PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-11 Thread Karsten Blees
Add trace_performance and trace_performance_since macros that print a duration and an optional printf-formatted text to the file specified in environment variable GIT_TRACE_PERFORMANCE. These macros, in conjunction with getnanotime(), are intended to simplify performance measurements from within t