git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Cc: Shawn Pearce <spearce@spearce.org>,
	Junio C Hamano <junkio@cox.net>,
	git@vger.kernel.org
Subject: Re: If I were redoing git from scratch...
Date: Sat, 4 Nov 2006 14:44:25 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0611041436050.25218@g5.osdl.org> (raw)
In-Reply-To: <200611042329.46556.robin.rosenberg.lists@dewire.com>



On Sat, 4 Nov 2006, Robin Rosenberg wrote:
> 
> The overhead is eigth bytes per object on a 32-bit platform and 16 on a 64-bit 
> platform for Sun's JDK. The granularity is eight bytes in both cases. 

Note that the object structure itself is just 24 bytes (regardless of 
whether we're on a 32-bit or 64-bit architecture).

In addition to that, we need one pointer per hash entry, and in order to 
keep the hash list size down we need that hash array to be about 25% free, 
so say 1.5 pointers per object: ~6 bytes or ~12 bytes depending on whether 
it's a 32- or 64-bit architecture.

So 8 or 16 bytes overhead per object is roughly a 25% or 50% pure 
overhead. In contrast, right now we have pretty much _zero_ overhead (we 
do end up having some malloc cost, but since we batch them, it's on the 
order of a few bytes per _thousand_ objects, so we're talking fractions of 
a percent).

Of course, the memory footprint isn't _just_ the objects, but it's a big 
part of it, for some important apps (not just repack, but git-send-pack 
obviously also has this). So on a git server, keeping the memory use down 
is likely the #1 concern - even if the server might have gigabytes of RAM.


  reply	other threads:[~2006-11-04 22:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-04 11:34 If I were redoing git from scratch Junio C Hamano
2006-11-04 12:21 ` Jakub Narebski
2006-11-04 16:44 ` Linus Torvalds
2006-11-04 19:16   ` Shawn Pearce
2006-11-04 22:29     ` Robin Rosenberg
2006-11-04 22:44       ` Linus Torvalds [this message]
2006-11-04 23:15         ` Linus Torvalds

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=Pine.LNX.4.64.0611041436050.25218@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=robin.rosenberg.lists@dewire.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).