From: Ryan Anderson <ryan@michonline.com>
To: Shawn Pearce <spearce@spearce.org>
Cc: Jon Smirl <jonsmirl@gmail.com>, git <git@vger.kernel.org>
Subject: Re: fast-import and unique objects.
Date: Mon, 7 Aug 2006 00:57:45 -0700 [thread overview]
Message-ID: <20060807075744.GB15477@h4x0r5.com> (raw)
In-Reply-To: <20060806180323.GA19120@spearce.org>
On Sun, Aug 06, 2006 at 02:03:24PM -0400, Shawn Pearce wrote:
>
> - It expects an estimated object count as its second parameter.
> In your case this would be something around 760000. This tells
> it how large of an object table to allocate, with each entry
> being 24 bytes + 1 pointer (28 or 32 bytes). Overshooting
> this number will cause it to degrade by allocating one
> overflow entry at a time from malloc.
Hrm, you're allocating a big table and then assigning consecutive
entries out of it, as pointers.
Why not just malloc a big block, and assign offsets into it, as if it
were a really big array. Every time it runs out, realloc it to double
the current size, and update the base pointer.
--
Ryan Anderson
sometimes Pug Majere
next prev parent reply other threads:[~2006-08-07 7:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-06 12:32 fast-import and unique objects Jon Smirl
2006-08-06 15:53 ` Jon Smirl
2006-08-06 18:03 ` Shawn Pearce
2006-08-07 4:48 ` Jon Smirl
2006-08-07 5:04 ` Shawn Pearce
2006-08-07 14:37 ` Jon Smirl
2006-08-07 14:48 ` Jakub Narebski
2006-08-07 18:45 ` Jon Smirl
2006-08-08 3:12 ` Shawn Pearce
2006-08-08 12:11 ` Jon Smirl
2006-08-08 22:45 ` Shawn Pearce
2006-08-08 23:56 ` Jon Smirl
2006-08-07 5:10 ` Martin Langhoff
2006-08-07 7:57 ` Ryan Anderson [this message]
2006-08-07 23:02 ` Shawn Pearce
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=20060807075744.GB15477@h4x0r5.com \
--to=ryan@michonline.com \
--cc=git@vger.kernel.org \
--cc=jonsmirl@gmail.com \
--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.
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 NNTP newsgroup(s).