git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: David Barr <david.barr@cordelta.com>
Cc: Git List <git@vger.kernel.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Stephen Boyd <bebarino@gmail.com>
Subject: Re: [PATCH 1/2] fast-import: use struct hash_table for atom strings
Date: Fri, 1 Apr 2011 22:33:21 -0500	[thread overview]
Message-ID: <20110402033321.GA7023@elie> (raw)
In-Reply-To: <20110402024209.GA6039@elie>

Jonathan Nieder wrote:

>> @@ -691,8 +691,12 @@ static struct atom_str *to_atom(const char *s, unsigned short len)
>>  	c->str_len = len;
>>  	strncpy(c->str_dat, s, len);
>>  	c->str_dat[len] = 0;
>> -	c->next_atom = atom_table[hc];
>> -	atom_table[hc] = c;
>> +	c->next_atom = NULL;
>> +	pos = insert_hash(hc, c, &atom_table);
>> +	if (pos) {
>> +		c->next_atom = *pos;
>> +		*pos = c;
>> +	}
>
> If I understand correctly, this puts new atoms at the start of the
> chain, just like v1.7.4-rc0~40^2 (fast-import: insert new object
> entries at start of hash bucket, 2010-11-23) did for objects.  Did you
> measure and find this faster, or is it just for simplicity or
> consistency?  (I'd personally be fine with it either way, but it seems
> prudent to ask.)

Agh.  Too-quick reading on my part (or rather, I lazily made an
assumption and didn't pay much attention to the old code at all).  I
have no reason to believe inserting at the end of the bucket would be
better, and it would certainly be more complex.

Sorry, folks.  Don't mind me.

  reply	other threads:[~2011-04-02  3:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 11:59 fast-import: use struct hash_table David Barr
2011-03-31 11:59 ` [PATCH 1/2] fast-import: use struct hash_table for atom strings David Barr
2011-04-02  2:42   ` Jonathan Nieder
2011-04-02  3:33     ` Jonathan Nieder [this message]
2011-03-31 11:59 ` [PATCH 2/2] fast-import: use struct hash_table for objects David Barr
2011-04-02  2:46   ` Jonathan Nieder
2011-04-02  2:48 ` fast-import: use struct hash_table Jonathan Nieder
2012-04-11 12:11 ` [PATCH/RFC v2 0/4] " Jonathan Nieder
2012-04-11 12:12 ` [PATCH/RFC v2 0/4 resend] " Jonathan Nieder
2012-04-11 12:13   ` [PATCH 1/4] fast-import: allow object_table to grow dynamically Jonathan Nieder
2012-04-11 12:14   ` [PATCH 2/4] fast-import: allow atom_table " Jonathan Nieder
2012-04-11 12:15   ` [PATCH 3/4] fast-import: allow branch_table " Jonathan Nieder
2012-04-11 12:15   ` [PATCH 4/4] fast-import: use DIV_ROUND_UP Jonathan Nieder

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20110402033321.GA7023@elie \
    --to=jrnieder@gmail.com \
    --cc=bebarino@gmail.com \
    --cc=david.barr@cordelta.com \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).