git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFH] git cherry vs. git rev-list --cherry, or: Why does "..." suck?

From
Jeff King <peff@peff.net>
Date
Mar 23, 2011, 17:19 UTC
Message-ID
<20110323171912.GD30337@sigill.intra.peff.net>
In-Reply-To
<4D889119.3020009@drmicha.warpmail.net>
On Tue, Mar 22, 2011 at 01:07:53PM +0100, Michael J Gruber wrote:
Show 9 quoted lines
> I don't get this:
> 
> git cherry A B: 0.4s
> git rev-list --cherry A...B: 1.7s
> (more details below)
> 
> This makes "rev-list --cherry" almost unacceptable as a replacement. But
> I'd like to understand this difference (and maybe do something about
> it). I'm lost with gprof, but here are more details on the timing:

I don't have much to say on the problem at hand, but have you tried using the "perf" tool from the kernel to measure? These days it ships in linux-tools-2.6.x in Debian unstable; I don't know about other distros.

You can do this:
  perf record git cherry $A $B >/dev/null
  perf record git rev-list --cherry $A...$B >/dev/null
  perf diff

to get a list of the hot-spots with the time differences between the two runs (along with "perf report" and "perf annotate" to get more information).

Disclaimer: I am very new to perf, so I may be misleading you about how
useful the "diff" would be. In particular, it seems to be based on a
percentages of time spent between two runs. Which is great for two runs
of the same program calling very similar functions. But for two programs
calling _mostly_ the same functions, I don't know how misleading it is.
-Peff
Previous: Michael J Gruber
Message 5 of 5 in “[RFH] git cherry vs. git rev-list --cherry, or: Why does "..." suck?”
  1. Michael J GruberMar 22, 2011
  2. Michael J GruberMar 23, 2011
  3. Junio C HamanoMar 23, 2011
  4. Michael J GruberMar 24, 2011
  5. Jeff KingMar 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.