All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC 5/5] Support 'master@2 hours ago' syntax
Date: Wed, 17 May 2006 18:32:46 -0400	[thread overview]
Message-ID: <20060517223246.GD30313@spearce.org> (raw)
In-Reply-To: <20060517220613.GC30313@spearce.org>

Shawn Pearce <spearce@spearce.org> wrote:
> Junio C Hamano <junkio@cox.net> wrote:
> >
> > Also I wonder how much complexity would we suffer and how much
> > efficiency would we gain if we binary search the logdata (the
> > committer info is variable length, so you would need to resync
> > in each step).
> 
> I thought about doing this but did not think it would be worth the
> effort (either developer to code or CPU to execute) at this point
> in time.  I don't think users will be pulling refs from the log very
> often and if they are they will probably be pulling from recent time,
> not very far back.  Thus starting at the end and walking back is
> probably "good enough".
> 
> But if it proves to be too slow in practice I'm sure I can come up
> with a faster way to walk through the log.  :-)

I just ran a test on my PowerBook: walking a 10,000 line log file and
extracting the very oldest commit along.  Each hit on git-rev-parse
seems to took about 100 ms.  Hardly worth worrying about for casual
use.  Further git-rev-parse is taking 73 ms just to run '--verify
HEAD' so an extra 30 ms to read the 10k log is pretty much nothing.

  [spearce@pb15 trash]$ wc -l .git/logs/refs/heads/master 
     10000 .git/logs/refs/heads/master
  [spearce@pb15 trash]$ head -n 1 .git/logs/refs/heads/master 
  b943559a305bdd6bdee2cef6e5df2413c3d30a00 0000000000000000000000000000000000000000 A U Thor <example@example.com> 1136091600 -0500
  [spearce@pb15 trash]$ perl -e 'print scalar(localtime shift),"\n"' 1136091600
  Sun Jan  1 00:00:00 2006
  [spearce@pb15 trash]$ time ../../git-rev-parse --verify HEAD@'300 days'
  warning: Log .git/logs/refs/heads/master only goes back to Thu, 1 Jan 1970 00:00:00 +0000.
  b943559a305bdd6bdee2cef6e5df2413c3d30a00
  
  real    0m0.112s
  user    0m0.029s
  sys     0m0.023s
  [spearce@pb15 trash]$ time ../../git-rev-parse --verify HEAD@'300 days'
  warning: Log .git/logs/refs/heads/master only goes back to Thu, 1 Jan 1970 00:00:00 +0000.
  b943559a305bdd6bdee2cef6e5df2413c3d30a00
  
  real    0m0.105s
  user    0m0.029s
  sys     0m0.023s

-- 
Shawn.

      reply	other threads:[~2006-05-17 22:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17  9:56 [RFC 5/5] Support 'master@2 hours ago' syntax Shawn Pearce
2006-05-17 11:07 ` Junio C Hamano
2006-05-17 14:46   ` Linus Torvalds
2006-05-17 18:32     ` Junio C Hamano
2006-05-17 21:39       ` Shawn Pearce
2006-05-17 22:06   ` Shawn Pearce
2006-05-17 22:32     ` Shawn Pearce [this message]

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=20060517223246.GD30313@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.